#! -*- coding: utf-8 -*-
import random
import pandas as pd
from chat_bot.models.NER.predict import NERPredictor
from chat_bot.models.intent_fasttext import config


# from nlpcda import baidu_translate

# 提取特定列
def extact_field(data, name):
    list = []
    for name in data[name]:
        list.append(name)
    return list


# 转为输入的格式
def get_input(query):
    # 加载停用词
    stopword = [word.strip() for word in open(config.stopword_path, 'r', encoding="utf-8").readlines()]
    # 加载模型
    model = NERPredictor()
    # 问句实体替换
    text = query
    input = ""
    dict = model.predict(text)
    if 'Crop' in dict:
        word_list = []
        for word in dict.get('Crop'):
            word_list.append(word)
        for i in range(0, len(word_list)):
            text = text.replace(word_list[i], "π")
    if 'Dis' in dict:
        word_list = []
        for word in dict.get('Dis'):
            word_list.append(word)
        for i in range(0, len(word_list)):
            text = text.replace(word_list[i], "ρ")
    if 'Pest' in dict:
        word_list = []
        for word in dict.get('Pest'):
            word_list.append(word)
        for i in range(0, len(word_list)):
            text = text.replace(word_list[i], "ς")
    if 'Drug' in dict:
        word_list = []
        for word in dict.get('Drug'):
            word_list.append(word)
        for i in range(0, len(word_list)):
            text = text.replace(word_list[i], "σ")
    # 去除停用词
    for i in range(0, len(stopword)):
        text = text.replace(stopword[i], "")
    for word in text:
        input += word + " "
    return input


# 生成回译数据
# def create_retroversion_data(data_dir):
#     data = pd.read_csv(data_dir)
#     text_list = extact_field(data, 'text')
#     label_class_list = extact_field(data, 'label_class')
#     label_list = extact_field(data, 'label')
#
#     zh = '天气晴朗，天气很不错，空气很好'
#     # 申请你的 appid、secretKey
#     # 两遍洗数据法（回来的中文一般和原来不一样，要是一样，就不要了，靠运气？）
#     en_s = baidu_translate(content=zh, appid='20211112000997083', secretKey='Ys8pAmZ8QA33WHcBRnQv', t_from='zh', t_to='en')
#     zh_s = baidu_translate(content=en_s, appid='20211112000997083', secretKey='Ys8pAmZ8QA33WHcBRnQv', t_from='en', t_to='zh')
#     print(zh_s)

# 实例化翻译对象
# translator = Translator()
# 进行第一次批量翻译, 翻译目标是韩语
# translations = translator.translate(text_list, 'en')
# 获得翻译后的结果
# ko_res = list(map(lambda x: x.text, translations))
# print(translations)
# 进行第二次批量翻译, 翻译目标是德语
# translations = translator.translate(ko_res, 'de')
# 获得翻译后的结果
# de_res = list(map(lambda x: x.text, translations))
# print(de_res)
# 最后在翻译回中文, 完成回译全部流程
# translations = translator.translate(de_res, 'zh-cn')
# cn_res = list(map(lambda x: x.text, translations))
# print(cn_res)
# retroversion_data = pd.DataFrame(zip(cn_res, label_class_list, label_list))
# retroversion_data = shuffle(retroversion_data)
# retroversion_data.to_csv(config.retroversion_data_path, index=None, header=['text','label_class','label'], sep="\x01")


# 构建模板数据
def get_template_data():
    greet_word = ['你好，麻烦问一下', '打扰问一下', '老师您好，', '', '您好', '请问，', '请教一下', '冒昧问一下', '问一下', '', '', '', '', '', '']
    explain_word = ['能否介绍一下', '想了解', '可以问一下', '能否告知', '如何理解', '说明一下', '解释一下', '解释解释', '能否科普下', '', '', '', '', '', '']
    how_word = ['怎样才能', '怎么做可以', '咋样', '咋', '怎么管理', '如何', '如何才可以', '如何做', '怎样', '怎么种', '什么手段可以', '采取什么技巧可以', '什么方法能',
                '怎么做才能', '我该如何种植', '我该咋样', '我该怎样', '我该如何', '有什么方法可以']
    how2_word = ['如何', '怎么', '怎么样', '咋样', '咋']
    how3_word = ['如何做', '怎么办', '怎么搞', '咋办', '咋搞']
    how4_word = ['如何', '怎么', '怎么样', '咋样', '咋', '要怎么']
    let_word = ['才可以', '才可', '才能', '才能够', '']
    causative_word = ['使得', '使', '让', '令']
    why_word = ['为何', '为什么', '点解', '为啥', '为甚', '何以', '怎么在', '干什么']
    call_word = ['有', '叫', '是']
    other1_word = ['还', '还可以', '又', '另', '另外', '换个', '换一个', '另一个', '别个', '其他的', '别的', '', '']
    other2_word = ['另外的', '换个', '换一个', '另一个', '别个', '其他的', '别的', '怎么用别的', '', '']
    what_word = ['什么', '啥', '哪些']
    what2_word = ['什么', '啥']
    what3_word = ['什么', '啥', '哪些', '谁']
    what4_word = ['什么', '啥', '哪个', '那个', '哪类']
    what5_word = ['什么', '啥', '几', '多少', '哪个', '那个']
    where_word = ['在哪', '在哪里', '在什么地方', '在何处', '在那里', '在哪儿', '', '']
    have_word = ['有', '会有', '存在', '会看见', '看到', '发现了', '出现']
    have2_word = ['有', '会有', '是']
    have3_word = ['有', '都有', '存在', '出现', '发生', '具有', '感染', '发']
    have4_word = ['有', '存在', '出现', '发生', '发']
    have5_word = ['有', '会有', '存在', '具有', '拥有', '都有', '用', '使用']
    have6_word = ['有', '会有', '存在', '具有']
    have7_word = ['有', '会有', '是', '存在', '具有', '表现']
    have8_word = ['有', '会有', '拥有', '存在', '具有', '都有']
    have9_word = ['有', '会有', '都有']
    have10_word = ['有', '会有', '存在', '具有', '分为', '划分为', '归类于', '划为']
    need_word = ['需要', '要', '会要']
    divide_word = ['有', '都有', '分为', '归属', '属于', '归为', '归类于', '划为']
    divide2_word = ['分类', '划分', '归类']
    lead_word = ['导致', '有', '造成', '出现', '存在', '发生', '引起', '引发']
    with_word = ['和', '与', '跟', '还有', '对于', '同']
    may_word = ['会不会', '是否会', '会', '是不是会']
    cause_word = ['原因', '成因', '缘由', '原有', '起因']
    alias1_word = ['名字', '学名', '别名', '俗称', '说法', '叫法', '其它表示', '其它表达', '俗名', '别称', '名称', '专业叫法', '民间叫法', '指称', '常用别名',
                   '真正学名']
    alias2_word = ['还可以怎么叫', '还可以咋说', '除了自己还叫什么', '被称为啥', '被称为什么']
    define1_word = ['定义', '意思', '意义', '介绍', '释义', '简介', '解释', '理解', '含义', '概念']
    define2_word = ['是什么意思', '是啥意思', '怎么解释', '如何理解']
    tips1_word = ['长势好', '结更多果实', '结果大', '高产', '出的好又快', '出粉率高', '种的好', '产量高', '没那么多病害']
    tips2_word = ['怎么种植', '如何种植才能长势好', '种植的方法', '种植的技巧', '种植步骤', '栽种方法', '栽种技巧', '如何种植才对', '怎么种植正确', '怎样种植方法是对的',
                  '的种植需要什么步骤', '怎么管理才好', '的种植有啥技巧', '最佳种植时间', '适合密植吗', '株距多少合适', '之间距离多少合适']
    classify_word = ['分类', '类别', '种类', '品种']
    classify2_word = ['分类', '划分', '分别', '分辨']
    difference1_word = ['区别', '差别', '不同', '差异', '不一样', '不相同', '差异性', '不同之处']
    difference2_word = ['区分', '分别', '分辨', '辨别', '判辩']
    same_word = ['相同', '一样', '同样', '同一个东西', '相似', '一致', '类似', '肖似', '相仿', '一个东西']
    infected_word = ['病害', '虫害', '疾病', '病', '虫子', '害虫', '病虫害', '常见病']
    easy_word = ['容易', '比较容易', '主要', '一般', '', '']
    easy2_word = ['容易', '比较容易', '']
    main_word = ['主要', '一般', '通常', '正常', '', '']
    stop_word = ['阻止', '防止', '阻断', '防治', '停止', '不让', '预防', '没有', '不存在']
    stop2_word = ['阻止', '阻止', '阻断', '停止', '减缓', '抑制', '压制', '遏抑', '制止', '抑止']
    none_word = ['消失', '不存在', '没有', '不见', '减缓', '根除']
    prevent_word = ['防治', '预防', '治疗', '阻止', '应对', '根除', '解决']
    prevent2_word = ['的发生', '的出现', '的爆发', '的存在', '']
    way_word = ['方法', '措施', '手段', '对策', '办法', '方式', '技巧', '举措']
    way2_word = ['方法', '手段', '办法', '方式']
    condition_word = ['条件', '情况', '环境', '情景', '因素', '前提']
    condition2_word = ['条件', '环境', '情景', '前提']
    spread_word = ['传播', '传染', '感染']
    face_word = ['对于', '']
    occur_word = ['发病', '发生', '出现']
    get_word = ['得', '感染', '患上']
    harm_word = ['为害', '危害', '影响', '伤害', '损害', '祸害', '加害', '摧残']
    harm2_word = ['为害', '危害', '影响', '伤害', '加害']
    harm3_word = ['为害', '危害', '影响', '伤害', '加害', '作用', '出现']
    target_word = ['对象', '目标', '东西', '作物']
    target2_word = ['对象', '目标', '东西', '病害', '疾病', '虫害', '害虫', '病虫害']
    bad_word = ['不好', '有坏处', '有害', '无益']
    plant_word = ['种植', '栽种', '培育', '栽培', '耕耘', '培植', '栽植']
    location_word = ['部位', '位置', '部分', '区域', '范围', '地方']
    location2_word = ['根系', '根尖', '叶子', '嫩叶', '植株基部']
    big_word = ['大', '广', '多', '广泛', '密集', '明显']
    symptom_word = ['症状', '病症', '特征', '表现', '前兆', '预兆', '样子']
    probably_word = ['大概在', '大约在', '比较大可能在', '很大程度在', '有可能在', '喜欢在', '爱在', '主要在', '一般在', '', '']
    time_word = ['时候', '季节', '时间', '时刻', '天气', '情况']
    appear_word = ['出没', '出现', '活动', '会有', '会存在', '会被看见', '会被发现']
    live_word = ['生活', '生长', '出没', '出现', '活动', '会有', '会存在', '会被看见', '会被发现']
    grow_word = ['生长', '成长', '滋长', '发展', '孕育']
    grow2_word = ['生长', '成长', '滋长', '不同阶段', '孕育']
    love_word = ['偏好', '喜爱', '喜欢', '爱', '怕', '害怕', '恐惧', '不喜欢', '不喜爱']
    temperature_word = ['热', '寒冷', '炎热', '冷', '水', '夜晚']
    habits_word = ['的食性', '的昼夜节律', '的出没节律', '的发育规律', '的生长快慢', '的生命周期', '的寿命多长', '的生长速度', '吃什么的', '偏好什么作物', '的大致偏好有啥',
                   '在什么温度下生活', '会害怕什么', '的天敌是什么']
    habits2_word = ['生活习性', '生活习惯', '习性', '习惯', '出没习惯', '多发季节', '多发时间', '惯例生活']
    character_word = ['长什么样', '大概摸样是', '有几个形态', '有多少个形态', '多大啊']
    character2_word = ['形态特征', '特征', '形态', '特点', '本领和特点', '外形', '外形特征', '特点和外形', '颜色', '外貌特征', '模样', '样子', '具体特征',
                       '外形特征', '形状和特点', '大小']
    character3_word = ['毛', '触角', '翅膀', '足', '口器', '复眼']
    suit_word = ['合理的', '合适的', '最佳的', '最优的', '科学的', '正确的', '恰当的', '', '']
    use_word = ['使用', '用', '施用', '操作', '运用', '利用', '应用', '冲施', '处理', '灌溉']
    cannot_word = ['不会', '不知道', '不懂', '没学过', '没听过', '没讲', '没见过']
    use2_word = ['该稀释多少倍', '怎么配比', '该用多大浓度', '要兑多少水', '什么时候打合适', '用量是多少', '用多少合适', '用在哪里合适', '什么时候大最有效', '最佳时间是',
                 '花期前能打吗', '如何使用安全', '怎么用量', '灌根效果好吗', '用在哪里好', '间隔多久使用']
    role_word = ['的作用', '的用途', '的用处', '']
    role2_word = ['作用', '用途', '用处', '效用', '影响', '效果', '功用']
    role3_word = ['杀虫', '杀螨', '除草', '杀老鼠', '杀菌', '提高产量', '调节生长', '触杀']
    toxicity1_word = ['的毒性有多强', '有没有毒', '是无毒的吗', '的副作用', '有毒吗', '的毒性', '毒性大吗', '有什么害处', '有什么危害', '对作物安全吗', '毒性多大',
                      '净毒性是', '毒性是', '的危害', '危害作物',
                      '毒性等级是', '是中等毒吗', '是剧毒吗', '有无毒性', '是低毒吗', '是高毒吗']
    toxicity2_word = ['影响', '伤害', '加害', '毒害', '威胁']
    toxicity3_word = ['影响', '害处', '危害', '伤害', '威胁', '损害', '毒害', '毒性']
    change_word = ['改变', '作用', '效用', '影响', '效果', '功用', '提升', '成效', '变化']
    do_word = ['干', '做']
    protect_word = ['防治', '作用', '施用', '防卫']
    can_word = ['可以', '能够', '能', '会']
    cannot2_word = ['不可以', '不能够', '不能', '不会', '不可']
    kill_word = ['消灭', '杀光', '根除', '杀死', '杀掉', '杀害', '扫除', '灭掉', '灭亡', '对付']
    all_word = ['所有', '全部', '绝大多数', '部分', '大多数', '一部分', '80%', '40%', '少数', '', '']
    belong_word = ['属于', '归类于', '归属于', '是', '归于', '在', '属']
    belong2_word = ['属于', '归类于', '归属于', '是', '归于', '属']
    distribution_word = ['分布', '分散', '散布', '漫延']
    distribution2_word = ['产地', '产源', '生产地']
    most_word = ['最多的', '至多的', '很多的', '大量的']
    area_word = ['区域', '位置', '范围', '地区', '地域', '概况']
    area2_word = ['区域', '位置', '范围', '地区', '地域', '分布']
    color_word = ['绿色', '黄色', '黄绿交替', '黄绿相间', '黑色', '灰色', '土黄色', '黄白交替', '橙色', '白色', '紫色', '绿色', '蓝色']
    color2_word = ['颜色', '色彩', '色调', '色彩基调', '色彩鲜艳度', '色彩鲜明度']
    num_word = ['几种', '几类', '多少种', '多少类', '好多种', '哪几种', '哪几类']
    season_word = ['时候', '季节', '时间', '时刻', '节气', '时节', '月份', '季度']
    flower_word = ['开花', '盛开', '绽开', '盛放', '着花', '吐花']
    flower2_word = ['花期', '开花时期', '的花的绽开', '的花的盛放', '的花的盛开']
    sun_word = ['光照', '阳光', '日照', '大阳光', '自然光照', '自然光']
    need2_word = ['需求', '需要', '须要', '时长需要', '时长需求', '时长', '要求', '强度', '强度需求', '强度要求']
    need3_word = ['需求', '需要', '须要', '要求']
    special_word = ['特别的', '特殊的', '特异的', '不同的', '需要注意的', '', '']
    difficulty_word = ['难度', '困难程度', '难处', '复杂程度']
    degree_word = ['困难', '艰难', '难度', '复杂程度', '困难程度', '难处', '艰难', '繁杂', '容易程度', '简单程度', '棘手', '艰巨']
    than_word = ['非常', '比较', '十分', '特别', '极度', '格外', '很', '最', '']
    degree2_word = ['简单', '困难', '艰巨', '繁琐', '容易', '好', '难']
    degree3_word = ['好不好', '简不简单', '难不难', '困难不困难', '容易不容易']
    temperature2_word = ['温度', '热度', '摄氏度', '气温']
    temperature3_word = ['热的', '寒冷的', '炎热的', '冷的']
    suit2_word = ['适宜', '合理', '合适', '最佳', '最优', '科学', '正确', '恰当', '', '']
    suit3_word = ['适宜', '适合', '得当', '符合', '合宜', '相宜', '合适', '吻合', '切合', '契合']
    acidBase_word = ['酸碱', '酸性', '碱性', 'PH值', '酸碱度']
    acidBase2_word = ['是酸性还是碱性', '是碱性还是酸性']
    area3_word = ['范围', '情况', '区域', '区间']
    land_word = ['土地', '土壤', '泥土']
    at_word = ['是', '在']
    character4_word = ['形态特征', '特征', '形态', '特点', '外形', '外形特征', '特点和外形', '颜色', '外观', '模样', '样子', '具体特征',
                       '外形特征', '形状和特点', '大小', '形状表现', '物理特征']
    character5_word = ['形态', '特征', '特点', '颜色', '外形特征', '形态特征', '特点和外形', '模样', '样子', '具体特征']
    surface_word = ['的表面', '的表层', '的大体', '的外层', '的最外层', '', '', '']
    describe_word = ['描述', '表述', '浅析', '分析', '表达', '简述', '阐述', '', '', '']
    extrude_word = ['突出', '明显', '最特别', '独特', '特别的', '特殊的', '特异的', '不同的', '需要注意的', '']
    way3_word = ['方法', '手段', '方式', '途径', '']
    breed_word = ['繁殖', '生殖', '繁衍']
    breed2_word = ['是无性生殖吗', '是有性生殖吗', '是无性生殖还是有性生殖', '用什么繁殖后代']
    use3_word = ['使用', '用', '利用', '通过', '依靠', '依赖', '凭借']
    flower3_word = ['开花', '盛开', '绽开', '盛放', '着花', '吐花', '花器']
    flower4_word = ['的花有多少朵', '的花瓣有片', '花的鲜明度', '花是不是很好看', '花的萎奄程度', '花的活力']

    # 类别
    label_list = [line.strip() for line in open(config.label, 'r', encoding='utf8')]
    label2id = {label: idx for idx, label in enumerate(label_list)}
    # 作物
    crop_list = [line.strip() for line in open(config.Crop, 'r', encoding='utf8')]
    crop_len = len(crop_list) - 1
    # 病害
    disease_list = [line.strip() for line in open(config.Dis, 'r', encoding='utf8')]
    disease_len = len(disease_list) - 1
    # 虫害
    pest_list = [line.strip() for line in open(config.Pest, 'r', encoding='utf8')]
    pest_len = len(pest_list) - 1
    # 农药
    drug_list = [line.strip() for line in open(config.Drug, 'r', encoding='utf8')]
    drug_len = len(drug_list) - 1

    # 存放模板数据
    data = []

    # 问别名
    def ask_alias(entity_list, entity_len):
        template = "{greet}{explain}{entity}{other1}{call}{what}{alias1}"
        for i in range(10):
            greet = greet_word[random.randint(0, len(greet_word) - 1)]
            explain = explain_word[random.randint(0, len(explain_word) - 1)]
            entity = entity_list[random.randint(0, entity_len)]
            other1 = other1_word[random.randint(0, len(other1_word) - 1)]
            call = call_word[random.randint(0, len(call_word) - 1)]
            what = what_word[random.randint(0, len(what_word) - 1)]
            alias1 = alias1_word[random.randint(0, len(alias1_word) - 1)]
            text = template.format(greet=greet, explain=explain, entity=entity, other1=other1, alias1=alias1, call=call,
                                   what=what)
            data.append([text, '别名', label2id['别名']])

        template = "{greet}{explain}{entity}{de}{alias1}{other1}{call}{what}"
        for i in range(10):
            greet = greet_word[random.randint(0, len(greet_word) - 1)]
            explain = explain_word[random.randint(0, len(explain_word) - 1)]
            entity = entity_list[random.randint(0, entity_len)]
            de = '的'
            alias1 = alias1_word[random.randint(0, len(alias1_word) - 1)]
            other1 = other1_word[random.randint(0, len(other1_word) - 1)]
            call = call_word[random.randint(0, len(call_word) - 1)]
            what = what_word[random.randint(0, len(what_word) - 1)]
            text = template.format(greet=greet, explain=explain, entity=entity, de=de, other1=other1, alias1=alias1,
                                   call=call, what=what)
            data.append([text, '别名', label2id['别名']])

        template = "{greet}{explain}{entity}{other2}{alias1}{call}{what}"
        for i in range(10):
            greet = greet_word[random.randint(0, len(greet_word) - 1)]
            explain = explain_word[random.randint(0, len(explain_word) - 1)]
            entity = entity_list[random.randint(0, entity_len)]
            other2 = other2_word[random.randint(0, len(other2_word) - 1)]
            alias1 = alias1_word[random.randint(0, len(alias1_word) - 1)]
            call = call_word[random.randint(0, len(call_word) - 1)]
            what = what_word[random.randint(0, len(what_word) - 1)]
            text = template.format(greet=greet, explain=explain, entity=entity, other2=other2, alias1=alias1, call=call,
                                   what=what)
            data.append([text, '别名', label2id['别名']])

        template = "{greet}{explain}{entity}{de}{alias1}{call}{what}"
        for i in range(10):
            greet = greet_word[random.randint(0, len(greet_word) - 1)]
            explain = explain_word[random.randint(0, len(explain_word) - 1)]
            entity = entity_list[random.randint(0, entity_len)]
            de = '的'
            alias1 = alias1_word[random.randint(0, len(alias1_word) - 1)]
            call = call_word[random.randint(0, len(call_word) - 1)]
            what = what_word[random.randint(0, len(what_word) - 1)]
            text = template.format(greet=greet, explain=explain, entity=entity, de=de, alias1=alias1, call=call,
                                   what=what)
            data.append([text, '别名', label2id['别名']])

        template = "{greet}{explain}{entity}{de}{alias1}"
        for i in range(10):
            greet = greet_word[random.randint(0, len(greet_word) - 1)]
            explain = explain_word[random.randint(0, len(explain_word) - 1)]
            entity = entity_list[random.randint(0, entity_len)]
            de = '的'
            alias1 = alias1_word[random.randint(0, len(alias1_word) - 1)]
            text = template.format(greet=greet, explain=explain, entity=entity, de=de, alias1=alias1)
            data.append([text, '别名', label2id['别名']])

        template = "{greet}{explain}{entity}{alias2}"
        for i in range(10):
            greet = greet_word[random.randint(0, len(greet_word) - 1)]
            explain = explain_word[random.randint(0, len(explain_word) - 1)]
            entity = entity_list[random.randint(0, entity_len)]
            alias2 = alias2_word[random.randint(0, len(alias2_word) - 1)]
            text = template.format(greet=greet, explain=explain, entity=entity, alias2=alias2)
            data.append([text, '别名', label2id['别名']])

    # 问简介
    def ask_define(entity_list, entity_len):
        template = "{greet}{explain}{entity}{de}{define1}"
        for i in range(8):
            greet = greet_word[random.randint(0, len(greet_word) - 1)]
            explain = explain_word[random.randint(0, len(explain_word) - 1)]
            entity = entity_list[random.randint(0, entity_len)]
            de = '的'
            if (i % 2 == 0):
                de = ""
            define1 = define1_word[random.randint(0, len(define1_word) - 1)]
            text = template.format(greet=greet, explain=explain, de=de, define1=define1, entity=entity)
            data.append([text, '简介', label2id['简介']])

        template = "{greet}{explain}{entity}{de}{define1}{shi}{what2}"
        for i in range(8):
            greet = greet_word[random.randint(0, len(greet_word) - 1)]
            explain = explain_word[random.randint(0, len(explain_word) - 1)]
            entity = entity_list[random.randint(0, entity_len)]
            de = '的'
            if (i % 2 == 0):
                de = ""
            define1 = define1_word[random.randint(0, len(define1_word) - 1)]
            shi = '是'
            what2 = what2_word[random.randint(0, len(what2_word) - 1)]
            text = template.format(greet=greet, explain=explain, de=de, define1=define1, shi=shi, entity=entity,
                                   what2=what2)
            data.append([text, '简介', label2id['简介']])

        template = "{greet}{explain}{what2}{shi}{entity}"
        for i in range(8):
            greet = greet_word[random.randint(0, len(greet_word) - 1)]
            explain = explain_word[random.randint(0, len(explain_word) - 1)]
            entity = entity_list[random.randint(0, entity_len)]
            shi = '是'
            what2 = what2_word[random.randint(0, len(what2_word) - 1)]
            text = template.format(greet=greet, explain=explain, shi=shi, entity=entity, what2=what2)
            data.append([text, '简介', label2id['简介']])

        template = "{greet}{explain}{entity}{shi}{what2}"
        for i in range(8):
            greet = greet_word[random.randint(0, len(greet_word) - 1)]
            explain = explain_word[random.randint(0, len(explain_word) - 1)]
            entity = entity_list[random.randint(0, entity_len)]
            shi = '是'
            what2 = what2_word[random.randint(0, len(what2_word) - 1)]
            text = template.format(greet=greet, explain=explain, shi=shi, entity=entity, what2=what2)
            data.append([text, '简介', label2id['简介']])

        template = "{greet}{explain}{entity}{define2}"
        for i in range(8):
            greet = greet_word[random.randint(0, len(greet_word) - 1)]
            explain = explain_word[random.randint(0, len(explain_word) - 1)]
            entity = entity_list[random.randint(0, entity_len)]
            define2 = define2_word[random.randint(0, len(define2_word) - 1)]
            text = template.format(greet=greet, explain=explain, entity=entity, define2=define2)
            data.append([text, '简介', label2id['简介']])

    # 问区别
    def ask_difference(entity_list, entity_len):
        template = "{greet}{explain}{entity1}{withV}{entity2}{have2}{what}{difference1}{ma}"
        for i in range(6):
            greet = greet_word[random.randint(0, len(greet_word) - 1)]
            explain = explain_word[random.randint(0, len(explain_word) - 1)]
            entity1 = entity_list[random.randint(0, entity_len)]
            entity2 = entity_list[random.randint(0, entity_len)]
            if (entity1 == entity2):
                entity2 = entity_list[random.randint(0, entity_len)]
            withV = with_word[random.randint(0, len(with_word) - 1)]
            have2 = have2_word[random.randint(0, len(have2_word) - 1)]
            what = what_word[random.randint(0, len(what_word) - 1)]
            difference1 = difference1_word[random.randint(0, len(difference1_word) - 1)]
            ma = '吗'
            if (i % 2 == 0):
                ma = ""
            text = template.format(greet=greet, explain=explain, entity1=entity1, withV=withV, entity2=entity2,
                                   have2=have2,
                                   what=what, difference1=difference1, ma=ma)
            data.append([text, '区别', label2id['区别']])

        template = "{greet}{explain}{entity1}{withV}{entity2}{yorn}{same}{de}"
        for i in range(6):
            greet = greet_word[random.randint(0, len(greet_word) - 1)]
            explain = explain_word[random.randint(0, len(explain_word) - 1)]
            entity1 = entity_list[random.randint(0, entity_len)]
            entity2 = entity_list[random.randint(0, entity_len)]
            if (entity1 == entity2):
                entity2 = entity_list[random.randint(0, entity_len)]
            withV = with_word[random.randint(0, len(with_word) - 1)]
            yorn = '是不是'
            same = same_word[random.randint(0, len(same_word) - 1)]
            de = '的'
            if ('东西' in same):
                de = ''
            text = template.format(greet=greet, explain=explain, entity1=entity1, withV=withV, entity2=entity2,
                                   yorn=yorn,
                                   same=same, de=de)
            data.append([text, '区别', label2id['区别']])

        template = "{greet}{explain}{entity1}{withV}{entity2}{shi}{same}{de}{ma}"
        for i in range(6):
            greet = greet_word[random.randint(0, len(greet_word) - 1)]
            explain = explain_word[random.randint(0, len(explain_word) - 1)]
            entity1 = entity_list[random.randint(0, entity_len)]
            entity2 = entity_list[random.randint(0, entity_len)]
            if (entity1 == entity2):
                entity2 = entity_list[random.randint(0, entity_len)]
            withV = with_word[random.randint(0, len(with_word) - 1)]
            shi = '是'
            same = same_word[random.randint(0, len(same_word) - 1)]
            de = '的'
            if ('东西' in same):
                de = ''
            ma = '吗'
            text = template.format(greet=greet, explain=explain, entity1=entity1, withV=withV, entity2=entity2, shi=shi,
                                   same=same, de=de, ma=ma)
            data.append([text, '区别', label2id['区别']])

        template = "{greet}{explain}{entity1}{withV}{entity2}{de}{difference1}{where}"
        for i in range(6):
            greet = greet_word[random.randint(0, len(greet_word) - 1)]
            explain = explain_word[random.randint(0, len(explain_word) - 1)]
            entity1 = entity_list[random.randint(0, entity_len)]
            entity2 = entity_list[random.randint(0, entity_len)]
            if (entity1 == entity2):
                entity2 = entity_list[random.randint(0, entity_len)]
            withV = with_word[random.randint(0, len(with_word) - 1)]
            difference1 = difference1_word[random.randint(0, len(difference1_word) - 1)]
            de = '的'
            if (i % 2 == 0):
                de = ''
            where = where_word[random.randint(0, len(where_word) - 1)]
            text = template.format(greet=greet, explain=explain, entity1=entity1, withV=withV, entity2=entity2,
                                   difference1=difference1, de=de, where=where)
            data.append([text, '区别', label2id['区别']])

        template = "{greet}{explain}{entity1}{withV}{entity2}{how2}{let}{difference2}"
        for i in range(6):
            greet = greet_word[random.randint(0, len(greet_word) - 1)]
            explain = explain_word[random.randint(0, len(explain_word) - 1)]
            entity1 = entity_list[random.randint(0, entity_len)]
            entity2 = entity_list[random.randint(0, entity_len)]
            if (entity1 == entity2):
                entity2 = entity_list[random.randint(0, entity_len)]
            withV = with_word[random.randint(0, len(with_word) - 1)]
            how2 = how2_word[random.randint(0, len(how2_word) - 1)]
            let = let_word[random.randint(0, len(let_word) - 1)]
            difference2 = difference2_word[random.randint(0, len(difference2_word) - 1)]
            text = template.format(greet=greet, explain=explain, entity1=entity1, withV=withV, entity2=entity2,
                                   how2=how2, let=let, difference2=difference2)
            data.append([text, '区别', label2id['区别']])

    # 问防治措施
    def ask_preventWay(entity_list, entity_len):
        template = "{greet}{explain}{how}{stop}{entity}{prevent2}"
        for i in range(44):
            greet = greet_word[random.randint(0, len(greet_word) - 1)]
            explain = explain_word[random.randint(0, len(explain_word) - 1)]
            how = how_word[random.randint(0, len(how_word) - 1)]
            stop = stop_word[random.randint(0, len(stop_word) - 1)]
            entity = entity_list[random.randint(0, entity_len)]
            prevent2 = prevent2_word[random.randint(0, len(prevent2_word) - 1)]
            text = template.format(greet=greet, explain=explain, how=how, stop=stop, entity=entity,
                                   prevent2=prevent2)
            data.append([text, '防治措施', label2id['防治措施']])

        template = "{greet}{explain}{entity}{de}{prevent}{way}"
        for i in range(44):
            greet = greet_word[random.randint(0, len(greet_word) - 1)]
            explain = explain_word[random.randint(0, len(explain_word) - 1)]
            entity = entity_list[random.randint(0, entity_len)]
            de = '的'
            prevent = prevent_word[random.randint(0, len(prevent_word) - 1)]
            way = way_word[random.randint(0, len(way_word) - 1)]
            text = template.format(greet=greet, explain=explain, entity=entity, de=de, prevent=prevent, way=way)
            data.append([text, '防治措施', label2id['防治措施']])

        template = "{greet}{explain}{entity}{de}{prevent}{way}{have2}{what}"
        for i in range(44):
            greet = greet_word[random.randint(0, len(greet_word) - 1)]
            explain = explain_word[random.randint(0, len(explain_word) - 1)]
            entity = entity_list[random.randint(0, entity_len)]
            de = '的'
            prevent = prevent_word[random.randint(0, len(prevent_word) - 1)]
            way = way_word[random.randint(0, len(way_word) - 1)]
            have2 = have2_word[random.randint(0, len(have2_word) - 1)]
            what = what_word[random.randint(0, len(what_word) - 1)]
            text = template.format(greet=greet, explain=explain, entity=entity, de=de, have2=have2, what=what,
                                   prevent=prevent, way=way)
            data.append([text, '防治措施', label2id['防治措施']])

        template = "{greet}{explain}{entity}{how2}{prevent}"
        for i in range(44):
            greet = greet_word[random.randint(0, len(greet_word) - 1)]
            explain = explain_word[random.randint(0, len(explain_word) - 1)]
            entity = entity_list[random.randint(0, entity_len)]
            how2 = how2_word[random.randint(0, len(how2_word) - 1)]
            prevent = prevent_word[random.randint(0, len(prevent_word) - 1)]
            text = template.format(greet=greet, explain=explain, entity=entity, prevent=prevent, how2=how2)
            data.append([text, '防治措施', label2id['防治措施']])

        template = "{greet}{explain}{how2}{causative}{entity}{none}"
        for i in range(44):
            greet = greet_word[random.randint(0, len(greet_word) - 1)]
            explain = explain_word[random.randint(0, len(explain_word) - 1)]
            entity = entity_list[random.randint(0, entity_len)]
            how2 = how2_word[random.randint(0, len(how2_word) - 1)]
            causative = causative_word[random.randint(0, len(causative_word) - 1)]
            none = none_word[random.randint(0, len(none_word) - 1)]
            text = template.format(greet=greet, explain=explain, entity=entity, causative=causative, how2=how2,
                                   none=none)
            data.append([text, '防治措施', label2id['防治措施']])

        template = "{greet}{explain}{how2}{prevent}{entity}"
        for i in range(44):
            greet = greet_word[random.randint(0, len(greet_word) - 1)]
            explain = explain_word[random.randint(0, len(explain_word) - 1)]
            entity = entity_list[random.randint(0, entity_len)]
            how2 = how2_word[random.randint(0, len(how2_word) - 1)]
            prevent = prevent_word[random.randint(0, len(prevent_word) - 1)]
            text = template.format(greet=greet, explain=explain, entity=entity, prevent=prevent, how2=how2)
            data.append([text, '防治措施', label2id['防治措施']])

        template = "{greet}{explain}{entity}{main}{have5}{what}{prevent}{way}"
        for i in range(44):
            greet = greet_word[random.randint(0, len(greet_word) - 1)]
            explain = explain_word[random.randint(0, len(explain_word) - 1)]
            entity = entity_list[random.randint(0, entity_len)]
            main = main_word[random.randint(0, len(main_word) - 1)]
            have5 = have5_word[random.randint(0, len(have5_word) - 1)]
            what = what_word[random.randint(0, len(what_word) - 1)]
            prevent = prevent_word[random.randint(0, len(prevent_word) - 1)]
            way = way_word[random.randint(0, len(way_word) - 1)]
            text = template.format(greet=greet, explain=explain, entity=entity, main=main, prevent=prevent, have5=have5,
                                   what=what, way=way)
            data.append([text, '防治措施', label2id['防治措施']])

        template = "{greet}{explain}{entity}{main}{have5}{what}{way}{prevent}"
        for i in range(44):
            greet = greet_word[random.randint(0, len(greet_word) - 1)]
            explain = explain_word[random.randint(0, len(explain_word) - 1)]
            entity = entity_list[random.randint(0, entity_len)]
            main = main_word[random.randint(0, len(main_word) - 1)]
            have5 = have5_word[random.randint(0, len(have5_word) - 1)]
            what = what_word[random.randint(0, len(what_word) - 1)]
            way = way_word[random.randint(0, len(way_word) - 1)]
            prevent = prevent_word[random.randint(0, len(prevent_word) - 1)]
            if (i % 2 == 0):
                prevent = ''
            text = template.format(greet=greet, explain=explain, entity=entity, main=main, prevent=prevent, have5=have5,
                                   what=what, way=way)
            data.append([text, '防治措施', label2id['防治措施']])

        # 虫害特有
        template = "{greet}{explain}{crop}{shang}{have}{pest}{how3}"
        for i in range(10):
            greet = greet_word[random.randint(0, len(greet_word) - 1)]
            explain = explain_word[random.randint(0, len(explain_word) - 1)]
            crop = crop_list[random.randint(0, crop_len)]
            pest = pest_list[random.randint(0, pest_len)]
            shang = '上'
            have = have_word[random.randint(0, len(have_word) - 1)]
            how3 = how3_word[random.randint(0, len(how3_word) - 1)]
            text = template.format(greet=greet, explain=explain, crop=crop, shang=shang, have=have, pest=pest,
                                   how3=how3)
            data.append([text, '防治措施', label2id['防治措施']])

        template = "{greet}{explain}{crop}{shang}{have}{pest}{how2}{prevent}"
        for i in range(10):
            greet = greet_word[random.randint(0, len(greet_word) - 1)]
            explain = explain_word[random.randint(0, len(explain_word) - 1)]
            crop = crop_list[random.randint(0, crop_len)]
            pest = pest_list[random.randint(0, pest_len)]
            shang = '上'
            have = have_word[random.randint(0, len(have_word) - 1)]
            how2 = how2_word[random.randint(0, len(how2_word) - 1)]
            prevent = prevent_word[random.randint(0, len(prevent_word) - 1)]
            text = template.format(greet=greet, explain=explain, crop=crop, shang=shang, have=have, pest=pest,
                                   how2=how2, prevent=prevent)
            data.append([text, '防治措施', label2id['防治措施']])

    # 问传播途径和发病条件
    def ask_spread(entity_list, entity_len):
        template = "{greet}{explain}{entity}{main}{zai}{face}{what}{wai}{condition}{xia}{lead}"
        for i in range(13):
            greet = greet_word[random.randint(0, len(greet_word) - 1)]
            explain = explain_word[random.randint(0, len(explain_word) - 1)]
            entity = entity_list[random.randint(0, entity_len)]
            main = main_word[random.randint(0, len(main_word) - 1)]
            zai = '在'
            face = face_word[random.randint(0, len(face_word) - 1)]
            what = what_word[random.randint(0, len(what_word) - 1)]
            wai = '外部'
            if (i % 2 == 0):
                wai = ''
            condition = condition_word[random.randint(0, len(condition_word) - 1)]
            xia = '下'
            lead = lead_word[random.randint(0, len(lead_word) - 1)]
            text = template.format(greet=greet, explain=explain, entity=entity, main=main, zai=zai, face=face,
                                   what=what, wai=wai, condition=condition, lead=lead, xia=xia)
            data.append([text, '传播途径与发病条件', label2id['传播途径与发病条件']])

        template = "{greet}{explain}{crop}{main}{zai}{face}{what}{wai}{condition}{xia}{easy2}{get}{entity}"
        for i in range(13):
            greet = greet_word[random.randint(0, len(greet_word) - 1)]
            explain = explain_word[random.randint(0, len(explain_word) - 1)]
            crop = crop_list[random.randint(0, crop_len)]
            entity = entity_list[random.randint(0, entity_len)]
            main = main_word[random.randint(0, len(main_word) - 1)]
            zai = '在'
            face = face_word[random.randint(0, len(face_word) - 1)]
            what = what_word[random.randint(0, len(what_word) - 1)]
            wai = '外部'
            if (i % 2 == 0):
                wai = ''
            condition = condition_word[random.randint(0, len(condition_word) - 1)]
            xia = '下'
            easy2 = easy2_word[random.randint(0, len(easy2_word) - 1)]
            get = get_word[random.randint(0, len(get_word) - 1)]
            text = template.format(greet=greet, explain=explain, crop=crop, entity=entity, main=main, zai=zai,
                                   face=face,
                                   what=what, wai=wai, condition=condition, get=get, xia=xia, easy2=easy2)
            data.append([text, '传播途径与发病条件', label2id['传播途径与发病条件']])

        template = "{greet}{explain}{entity}{have4}{de}{wai}{condition2}"
        for i in range(13):
            greet = greet_word[random.randint(0, len(greet_word) - 1)]
            explain = explain_word[random.randint(0, len(explain_word) - 1)]
            entity = entity_list[random.randint(0, entity_len)]
            have4 = have4_word[random.randint(0, len(have4_word) - 1)]
            de = '的'
            wai = '外部'
            if (i % 2 == 0):
                wai = ''
            condition2 = condition2_word[random.randint(0, len(condition2_word) - 1)]
            text = template.format(greet=greet, explain=explain, entity=entity, have4=have4, de=de,
                                   wai=wai, condition2=condition2)
            data.append([text, '传播途径与发病条件', label2id['传播途径与发病条件']])

        template = "{greet}{explain}{entity}{de}{occur}{condition}{shi}{what2}"
        for i in range(13):
            greet = greet_word[random.randint(0, len(greet_word) - 1)]
            explain = explain_word[random.randint(0, len(explain_word) - 1)]
            entity = entity_list[random.randint(0, entity_len)]
            de = '的'
            occur = occur_word[random.randint(0, len(occur_word) - 1)]
            condition = condition_word[random.randint(0, len(condition_word) - 1)]
            shi = '是'
            what2 = what2_word[random.randint(0, len(what2_word) - 1)]
            if (i % 2 == 0):
                what2 = ''
                shi = ''
            text = template.format(greet=greet, explain=explain, entity=entity, occur=occur, de=de,
                                   condition=condition, what2=what2, shi=shi)
            data.append([text, '传播途径与发病条件', label2id['传播途径与发病条件']])

        template = "{greet}{explain}{entity}{lead}{de}{condition}{shi}{what2}"
        for i in range(13):
            greet = greet_word[random.randint(0, len(greet_word) - 1)]
            explain = explain_word[random.randint(0, len(explain_word) - 1)]
            entity = entity_list[random.randint(0, entity_len)]
            de = '的'
            lead = lead_word[random.randint(0, len(lead_word) - 1)]
            condition = condition_word[random.randint(0, len(condition_word) - 1)]
            shi = '是'
            what2 = what2_word[random.randint(0, len(what2_word) - 1)]
            if (i % 2 == 0):
                what2 = ''
                shi = ''
            text = template.format(greet=greet, explain=explain, entity=entity, lead=lead, de=de,
                                   condition=condition, what2=what2, shi=shi)
            data.append([text, '传播途径与发病条件', label2id['传播途径与发病条件']])

        template = "{greet}{explain}{entity}{shi}{what}{condition}{xia}{lead}{de}"
        for i in range(13):
            greet = greet_word[random.randint(0, len(greet_word) - 1)]
            explain = explain_word[random.randint(0, len(explain_word) - 1)]
            entity = entity_list[random.randint(0, entity_len)]
            de = '的'
            lead = lead_word[random.randint(0, len(lead_word) - 1)]
            condition = condition_word[random.randint(0, len(condition_word) - 1)]
            shi = '是'
            xia = '下'
            what = what_word[random.randint(0, len(what_word) - 1)]
            text = template.format(greet=greet, explain=explain, entity=entity, lead=lead, de=de,
                                   condition=condition, what=what, shi=shi, xia=xia)
            data.append([text, '传播途径与发病条件', label2id['传播途径与发病条件']])

        template = "{greet}{explain}{entity}{through}{what}{way2}{spread}{de}"
        for i in range(13):
            greet = greet_word[random.randint(0, len(greet_word) - 1)]
            explain = explain_word[random.randint(0, len(explain_word) - 1)]
            entity = entity_list[random.randint(0, entity_len)]
            through = '是通过'
            what = what_word[random.randint(0, len(what_word) - 1)]
            way2 = way2_word[random.randint(0, len(way2_word) - 1)]
            spread = spread_word[random.randint(0, len(spread_word) - 1)]
            de = '的'
            text = template.format(greet=greet, explain=explain, entity=entity, through=through, what=what, way2=way2,
                                   spread=spread, de=de)
            data.append([text, '传播途径与发病条件', label2id['传播途径与发病条件']])

    # 问为害对象
    def ask_harmObject(entity_list, entity_len):
        template = "{greet}{explain}{entity}{de}{harm2}{target}{have2}{what3}"
        for i in range(15):
            greet = greet_word[random.randint(0, len(greet_word) - 1)]
            explain = explain_word[random.randint(0, len(explain_word) - 1)]
            entity = entity_list[random.randint(0, entity_len)]
            de = '的'
            harm2 = harm2_word[random.randint(0, len(harm2_word) - 1)]
            target = target_word[random.randint(0, len(target_word) - 1)]
            have2 = have2_word[random.randint(0, len(have2_word) - 1)]
            what3 = what3_word[random.randint(0, len(what3_word) - 1)]
            text = template.format(greet=greet, explain=explain, de=de, entity=entity, harm2=harm2, target=target,
                                   have2=have2, what3=what3)
            data.append([text, '为害对象', label2id['为害对象']])

        template = "{greet}{explain}{entity}{harm}{what3}"
        for i in range(15):
            greet = greet_word[random.randint(0, len(greet_word) - 1)]
            explain = explain_word[random.randint(0, len(explain_word) - 1)]
            entity = entity_list[random.randint(0, entity_len)]
            harm = harm_word[random.randint(0, len(harm_word) - 1)]
            what3 = what3_word[random.randint(0, len(what3_word) - 1)]
            text = template.format(greet=greet, explain=explain, entity=entity, harm=harm, what3=what3)
            data.append([text, '为害对象', label2id['为害对象']])

        template = "{greet}{explain}{entity}{main}{harm}{what}{target}"
        for i in range(15):
            greet = greet_word[random.randint(0, len(greet_word) - 1)]
            explain = explain_word[random.randint(0, len(explain_word) - 1)]
            entity = entity_list[random.randint(0, entity_len)]
            main = main_word[random.randint(0, len(main_word) - 1)]
            harm = harm_word[random.randint(0, len(harm_word) - 1)]
            what = what_word[random.randint(0, len(what_word) - 1)]
            target = target_word[random.randint(0, len(target_word) - 1)]
            text = template.format(greet=greet, explain=explain, entity=entity, main=main, harm=harm, what=what,
                                   target=target)
            data.append([text, '为害对象', label2id['为害对象']])

        template = "{greet}{explain}{entity}{face}{what}{target}{bad}"
        for i in range(15):
            greet = greet_word[random.randint(0, len(greet_word) - 1)]
            explain = explain_word[random.randint(0, len(explain_word) - 1)]
            entity = entity_list[random.randint(0, entity_len)]
            face = face_word[random.randint(0, len(face_word) - 1)]
            what = what_word[random.randint(0, len(what_word) - 1)]
            target = target_word[random.randint(0, len(target_word) - 1)]
            bad = bad_word[random.randint(0, len(bad_word) - 1)]
            text = template.format(greet=greet, explain=explain, entity=entity, face=face, bad=bad, what=what,
                                   target=target)
            data.append([text, '为害对象', label2id['为害对象']])

        template = "{greet}{explain}{entity}{face}{my}{plant}{de}{crop}{have6}{harm2}{ma}"
        for i in range(15):
            greet = greet_word[random.randint(0, len(greet_word) - 1)]
            explain = explain_word[random.randint(0, len(explain_word) - 1)]
            entity = entity_list[random.randint(0, entity_len)]
            face = face_word[random.randint(0, len(face_word) - 1)]
            my = '我'
            plant = plant_word[random.randint(0, len(plant_word) - 1)]
            de = '的'
            crop = crop_list[random.randint(0, crop_len)]
            if (i % 5 == 0):
                crop = '作物'
            have6 = have6_word[random.randint(0, len(have6_word) - 1)]
            harm2 = harm2_word[random.randint(0, len(harm2_word) - 1)]
            ma = '吗'
            text = template.format(greet=greet, explain=explain, entity=entity, face=face, my=my, plant=plant, de=de,
                                   crop=crop, have6=have6, harm2=harm2, ma=ma)
            data.append([text, '为害对象', label2id['为害对象']])

        template = "{greet}{explain}{entity}{face}{my}{plant}{de}{crop}{bad}{ma}"
        for i in range(15):
            greet = greet_word[random.randint(0, len(greet_word) - 1)]
            explain = explain_word[random.randint(0, len(explain_word) - 1)]
            entity = entity_list[random.randint(0, entity_len)]
            face = face_word[random.randint(0, len(face_word) - 1)]
            my = '我'
            plant = plant_word[random.randint(0, len(plant_word) - 1)]
            de = '的'
            crop = crop_list[random.randint(0, crop_len)]
            if (i % 5 == 0):
                crop = '作物'
            bad = bad_word[random.randint(0, len(bad_word) - 1)]
            ma = '吗'
            text = template.format(greet=greet, explain=explain, entity=entity, face=face, my=my, plant=plant, de=de,
                                   crop=crop, bad=bad, ma=ma)
            data.append([text, '为害对象', label2id['为害对象']])

        template = "{greet}{explain}{entity}{may}{harm}{crop}{ma}"
        for i in range(15):
            greet = greet_word[random.randint(0, len(greet_word) - 1)]
            explain = explain_word[random.randint(0, len(explain_word) - 1)]
            entity = entity_list[random.randint(0, entity_len)]
            may = may_word[random.randint(0, len(may_word) - 1)]
            harm = harm_word[random.randint(0, len(harm_word) - 1)]
            crop = crop_list[random.randint(0, crop_len)]
            if (i % 5 == 0):
                crop = '作物'
            ma = ""
            if (may == "会"):
                ma = "吗？"
            text = template.format(greet=greet, explain=explain, entity=entity, may=may, harm=harm, crop=crop, ma=ma)
            data.append([text, '为害对象', label2id['为害对象']])

    # 问为害部位
    def ask_harmLocation(entity_list, entity_len):
        template = "{greet}{explain}{entity}{main}{harm3}{what}{location}"
        for i in range(20):
            greet = greet_word[random.randint(0, len(greet_word) - 1)]
            explain = explain_word[random.randint(0, len(explain_word) - 1)]
            entity = entity_list[random.randint(0, entity_len)]
            main = main_word[random.randint(0, len(main_word) - 1)]
            harm3 = harm3_word[random.randint(0, len(harm3_word) - 1)]
            what = what_word[random.randint(0, len(what_word) - 1)]
            location = location_word[random.randint(0, len(location_word) - 1)]
            text = template.format(greet=greet, explain=explain, entity=entity, main=main, harm3=harm3, what=what,
                                   location=location)
            data.append([text, '为害部位', label2id['为害部位']])

        template = "{greet}{explain}{entity}{main}{harm3}{crop}{de}{what}{location}"
        for i in range(20):
            greet = greet_word[random.randint(0, len(greet_word) - 1)]
            explain = explain_word[random.randint(0, len(explain_word) - 1)]
            entity = entity_list[random.randint(0, entity_len)]
            main = main_word[random.randint(0, len(main_word) - 1)]
            harm3 = harm3_word[random.randint(0, len(harm3_word) - 1)]
            crop = crop_list[random.randint(0, crop_len)]
            if (i % 5 == 0):
                crop = '作物'
            de = '的'
            what = what_word[random.randint(0, len(what_word) - 1)]
            location = location_word[random.randint(0, len(location_word) - 1)]
            text = template.format(greet=greet, explain=explain, entity=entity, main=main, harm3=harm3, crop=crop,
                                   de=de, what=what, location=location)
            data.append([text, '为害部位', label2id['为害部位']])

        template = "{greet}{explain}{entity}{may}{main}{harm3}{location2}{ma}"
        for i in range(20):
            greet = greet_word[random.randint(0, len(greet_word) - 1)]
            explain = explain_word[random.randint(0, len(explain_word) - 1)]
            entity = entity_list[random.randint(0, entity_len)]
            may = may_word[random.randint(0, len(may_word) - 1)]
            main = main_word[random.randint(0, len(main_word) - 1)]
            harm3 = harm3_word[random.randint(0, len(harm3_word) - 1)]
            location2 = location2_word[random.randint(0, len(location2_word) - 1)]
            ma = ""
            if (may == "会"):
                ma = "吗？"
            text = template.format(greet=greet, explain=explain, entity=entity, may=may, main=main, harm3=harm3,
                                   location2=location2, ma=ma)
            data.append([text, '为害部位', label2id['为害部位']])

        template = "{greet}{explain}{entity}{main}{harm3}{location}{where}"
        for i in range(20):
            greet = greet_word[random.randint(0, len(greet_word) - 1)]
            explain = explain_word[random.randint(0, len(explain_word) - 1)]
            entity = entity_list[random.randint(0, entity_len)]
            main = main_word[random.randint(0, len(main_word) - 1)]
            harm3 = harm3_word[random.randint(0, len(harm3_word) - 1)]
            where = where_word[random.randint(0, len(where_word) - 1)]
            location = location_word[random.randint(0, len(location_word) - 1)]
            text = template.format(greet=greet, explain=explain, entity=entity, main=main, harm3=harm3, where=where,
                                   location=location)
            data.append([text, '为害部位', label2id['为害部位']])

        template = "{greet}{explain}{entity}{de}{harm3}{location}{big}{ma}"
        for i in range(20):
            greet = greet_word[random.randint(0, len(greet_word) - 1)]
            explain = explain_word[random.randint(0, len(explain_word) - 1)]
            entity = entity_list[random.randint(0, entity_len)]
            de = '的'
            harm3 = harm3_word[random.randint(0, len(harm3_word) - 1)]
            big = big_word[random.randint(0, len(big_word) - 1)]
            location = location_word[random.randint(0, len(location_word) - 1)]
            ma = '吗'
            text = template.format(greet=greet, explain=explain, entity=entity, de=de, harm3=harm3, big=big,
                                   location=location, ma=ma)
            data.append([text, '为害部位', label2id['为害部位']])

    # 问为害症状
    def ask_harmSymptom(entity_list, entity_len):
        template = "{greet}{explain}{crop}{get}{entity}{de}{symptom}{shi}{what2}"
        for i in range(25):
            greet = greet_word[random.randint(0, len(greet_word) - 1)]
            explain = explain_word[random.randint(0, len(explain_word) - 1)]
            crop = crop_list[random.randint(0, crop_len)]
            if (i % 5 == 0):
                crop = '作物'
                if (i % 10 == 0):
                    crop = ''
            get = get_word[random.randint(0, len(get_word) - 1)]
            entity = entity_list[random.randint(0, entity_len)]
            de = '的'
            symptom = symptom_word[random.randint(0, len(symptom_word) - 1)]
            shi = '是'
            what2 = what2_word[random.randint(0, len(what2_word) - 1)]
            if (i % 2 == 0):
                shi = ''
                what2 = ''
            text = template.format(greet=greet, explain=explain, crop=crop, get=get, entity=entity, de=de,
                                   symptom=symptom, shi=shi, what2=what2)
            data.append([text, '为害症状', label2id['为害症状']])

        template = "{greet}{explain}{crop}{get}{entity}{have7}{what}{symptom}"
        for i in range(25):
            greet = greet_word[random.randint(0, len(greet_word) - 1)]
            explain = explain_word[random.randint(0, len(explain_word) - 1)]
            crop = crop_list[random.randint(0, crop_len)]
            if (i % 5 == 0):
                crop = '作物'
                if (i % 10 == 0):
                    crop = ''
            get = get_word[random.randint(0, len(get_word) - 1)]
            entity = entity_list[random.randint(0, entity_len)]
            have7 = have7_word[random.randint(0, len(have7_word) - 1)]
            what = what_word[random.randint(0, len(what2_word) - 1)]
            symptom = symptom_word[random.randint(0, len(symptom_word) - 1)]
            text = template.format(greet=greet, explain=explain, crop=crop, get=get, entity=entity, have7=have7,
                                   what=what, symptom=symptom)
            data.append([text, '为害症状', label2id['为害症状']])

        template = "{greet}{explain}{crop}{get}{entity}{have7}{what}{than}{big}{de}{symptom}"
        for i in range(25):
            greet = greet_word[random.randint(0, len(greet_word) - 1)]
            explain = explain_word[random.randint(0, len(explain_word) - 1)]
            crop = crop_list[random.randint(0, crop_len)]
            if (i % 5 == 0):
                crop = '作物'
                if (i % 10 == 0):
                    crop = ''
            get = get_word[random.randint(0, len(get_word) - 1)]
            entity = entity_list[random.randint(0, entity_len)]
            have7 = have7_word[random.randint(0, len(have7_word) - 1)]
            what = what_word[random.randint(0, len(what2_word) - 1)]
            than = '比较'
            big = big_word[random.randint(0, len(big_word) - 1)]
            de = '的'
            symptom = symptom_word[random.randint(0, len(symptom_word) - 1)]
            text = template.format(greet=greet, explain=explain, crop=crop, get=get, entity=entity, have7=have7,
                                   what=what, than=than, big=big, de=de, symptom=symptom)
            data.append([text, '为害症状', label2id['为害症状']])

    # 作物
    # 问别名
    ask_alias(crop_list, crop_len)

    # 问简介
    ask_define(crop_list, crop_len)

    # 问种植技巧
    template = "{greet}{how}{causative}{crop}{tips1}"
    for i in range(100):
        greet = greet_word[random.randint(0, len(greet_word) - 1)]
        how = how_word[random.randint(0, len(how_word) - 1)]
        causative = causative_word[random.randint(0, len(causative_word) - 1)]
        crop = crop_list[random.randint(0, crop_len)]
        tips1 = tips1_word[random.randint(0, len(tips1_word) - 1)]
        text = template.format(greet=greet, how=how, causative=causative, crop=crop, tips1=tips1)
        data.append([text, '种植技巧', label2id['种植技巧']])

    template = "{greet}{explain}{crop}{tips2}"
    for i in range(50):
        greet = greet_word[random.randint(0, len(greet_word) - 1)]
        explain = explain_word[random.randint(0, len(explain_word) - 1)]
        crop = crop_list[random.randint(0, crop_len)]
        tips2 = tips2_word[random.randint(0, len(tips2_word) - 1)]
        text = template.format(greet=greet, explain=explain, crop=crop, tips2=tips2)
        data.append([text, '种植技巧', label2id['种植技巧']])

    # 问所属类别
    template = "{greet}{explain}{crop}{divide}{what}{classify}"
    for i in range(50):
        greet = greet_word[random.randint(0, len(greet_word) - 1)]
        explain = explain_word[random.randint(0, len(explain_word) - 1)]
        crop = crop_list[random.randint(0, crop_len)]
        divide = divide_word[random.randint(0, len(divide_word) - 1)]
        what = what_word[random.randint(0, len(what_word) - 1)]
        classify = classify_word[random.randint(0, len(classify_word) - 1)]
        if (i % 5 == 0):
            classify = ''
        text = template.format(greet=greet, explain=explain, crop=crop, divide=divide, what=what, classify=classify)
        data.append([text, '所属类别', label2id['所属类别']])

    template = "{greet}{explain}{crop}{de}{classify}{have2}{what}"
    for i in range(50):
        greet = greet_word[random.randint(0, len(greet_word) - 1)]
        explain = explain_word[random.randint(0, len(explain_word) - 1)]
        crop = crop_list[random.randint(0, crop_len)]
        de = '的'
        have2 = have2_word[random.randint(0, len(have2_word) - 1)]
        what = what_word[random.randint(0, len(what_word) - 1)]
        classify = classify_word[random.randint(0, len(classify_word) - 1)]
        text = template.format(greet=greet, explain=explain, crop=crop, de=de, have2=have2, what=what,
                               classify=classify)
        data.append([text, '所属类别', label2id['所属类别']])

    template = "{greet}{explain}{crop}{shi}{what2}{classify}{de}"
    for i in range(50):
        greet = greet_word[random.randint(0, len(greet_word) - 1)]
        explain = explain_word[random.randint(0, len(explain_word) - 1)]
        crop = crop_list[random.randint(0, crop_len)]
        shi = '是'
        what2 = what2_word[random.randint(0, len(what2_word) - 1)]
        classify = classify_word[random.randint(0, len(classify_word) - 1)]
        de = '的'
        text = template.format(greet=greet, explain=explain, crop=crop, shi=shi, what2=what2, classify=classify, de=de)
        data.append([text, '所属类别', label2id['所属类别']])

    template = "{greet}{explain}{crop}{how2}{divide2}"
    for i in range(50):
        greet = greet_word[random.randint(0, len(greet_word) - 1)]
        explain = explain_word[random.randint(0, len(explain_word) - 1)]
        crop = crop_list[random.randint(0, crop_len)]
        how2 = how2_word[random.randint(0, len(how2_word) - 1)]
        divide2 = divide2_word[random.randint(0, len(divide2_word) - 1)]
        text = template.format(greet=greet, explain=explain, crop=crop, how2=how2, divide2=divide2)
        data.append([text, '所属类别', label2id['所属类别']])

    # 问区别
    ask_difference(crop_list, crop_len)

    # 问易感病虫害
    template = "{greet}{explain}{crop}{hui}{easy}{have3}{de}{infected}{have2}{what}"
    for i in range(33):
        greet = greet_word[random.randint(0, len(greet_word) - 1)]
        explain = explain_word[random.randint(0, len(explain_word) - 1)]
        crop = crop_list[random.randint(0, crop_len)]
        hui = '会'
        if (i % 2 == 0):
            hui = ''
        easy = easy_word[random.randint(0, len(easy_word) - 1)]
        have3 = have3_word[random.randint(0, len(have3_word) - 1)]
        de = '的'
        infected = infected_word[random.randint(0, len(infected_word) - 1)]
        have2 = have2_word[random.randint(0, len(have2_word) - 1)]
        what = what_word[random.randint(0, len(what_word) - 1)]
        text = template.format(greet=greet, explain=explain, crop=crop, hui=hui, easy=easy, have3=have3, de=de,
                               infected=infected, have2=have2, what=what)
        data.append([text, '易感病虫害', label2id['易感病虫害']])

    template = "{greet}{explain}{crop}{infected2}{have2}{what}"
    for i in range(10):
        greet = greet_word[random.randint(0, len(greet_word) - 1)]
        explain = explain_word[random.randint(0, len(explain_word) - 1)]
        crop = crop_list[random.randint(0, crop_len)]
        have2 = have2_word[random.randint(0, len(have2_word) - 1)]
        infected2 = '易感病虫害'
        what = what_word[random.randint(0, len(what_word) - 1)]
        text = template.format(greet=greet, explain=explain, crop=crop, have2=have2, infected2=infected2, what=what)
        data.append([text, '易感病虫害', label2id['易感病虫害']])

    template = "{greet}{explain}{crop}{easy}{hui}{have3}{what}{infected}"
    for i in range(33):
        greet = greet_word[random.randint(0, len(greet_word) - 1)]
        explain = explain_word[random.randint(0, len(explain_word) - 1)]
        crop = crop_list[random.randint(0, crop_len)]
        hui = '会'
        if (i % 2 == 0):
            hui = ''
        easy = easy_word[random.randint(0, len(easy_word) - 1)]
        have3 = have3_word[random.randint(0, len(have3_word) - 1)]
        infected = infected_word[random.randint(0, len(infected_word) - 1)]
        what = what_word[random.randint(0, len(what_word) - 1)]
        text = template.format(greet=greet, explain=explain, crop=crop, hui=hui, easy=easy, have3=have3,
                               infected=infected, what=what)
        data.append([text, '易感病虫害', label2id['易感病虫害']])

    template = "{greet}{explain}{crop}{hui}{have3}{disease}{ma}"
    for i in range(10):
        greet = greet_word[random.randint(0, len(greet_word) - 1)]
        explain = explain_word[random.randint(0, len(explain_word) - 1)]
        crop = crop_list[random.randint(0, crop_len)]
        hui = '会'
        have3 = have3_word[random.randint(0, len(have3_word) - 1)]
        disease = disease_list[random.randint(0, disease_len)]
        ma = '吗'
        text = template.format(greet=greet, explain=explain, crop=crop, hui=hui, have3=have3, disease=disease, ma=ma)
        data.append([text, '易感病虫害', label2id['易感病虫害']])

    template = "{greet}{explain}{crop}{hui}{have3}{pest}{ma}"
    for i in range(10):
        greet = greet_word[random.randint(0, len(greet_word) - 1)]
        explain = explain_word[random.randint(0, len(explain_word) - 1)]
        crop = crop_list[random.randint(0, crop_len)]
        hui = '会'
        have3 = have3_word[random.randint(0, len(have3_word) - 1)]
        pest = pest_list[random.randint(0, pest_len)]
        ma = '吗'
        text = template.format(greet=greet, explain=explain, crop=crop, hui=hui, have3=have3, pest=pest, ma=ma)
        data.append([text, '易感病虫害', label2id['易感病虫害']])

    template = "{greet}{explain}{crop}{need}{prevent}{what}{infected}"
    for i in range(33):
        greet = greet_word[random.randint(0, len(greet_word) - 1)]
        explain = explain_word[random.randint(0, len(explain_word) - 1)]
        crop = crop_list[random.randint(0, crop_len)]
        need = need_word[random.randint(0, len(need_word) - 1)]
        prevent = prevent_word[random.randint(0, len(prevent_word) - 1)]
        what = what_word[random.randint(0, len(what_word) - 1)]
        infected = infected_word[random.randint(0, len(infected_word) - 1)]
        text = template.format(greet=greet, explain=explain, crop=crop, need=need, prevent=prevent, what=what,
                               infected=infected)
        data.append([text, '易感病虫害', label2id['易感病虫害']])

    template = "{greet}{explain}{crop}{de}{infected}"
    for i in range(33):
        greet = greet_word[random.randint(0, len(greet_word) - 1)]
        explain = explain_word[random.randint(0, len(explain_word) - 1)]
        crop = crop_list[random.randint(0, crop_len)]
        de = '的'
        infected = infected_word[random.randint(0, len(infected_word) - 1)]
        text = template.format(greet=greet, explain=explain, crop=crop, de=de, infected=infected)
        data.append([text, '易感病虫害', label2id['易感病虫害']])

    # 问属目
    template = "{greet}{explain}{crop}{belong}{what4}{orders}"
    for i in range(70):
        greet = greet_word[random.randint(0, len(greet_word) - 1)]
        explain = explain_word[random.randint(0, len(explain_word) - 1)]
        crop = crop_list[random.randint(0, crop_len)]
        belong = belong_word[random.randint(0, len(belong_word) - 1)]
        what4 = what4_word[random.randint(0, len(what4_word) - 1)]
        orders = '目'
        text = template.format(greet=greet, explain=explain, crop=crop, belong=belong, what4=what4, orders=orders)
        data.append([text, '属目', label2id['属目']])

    template = "{greet}{explain}{crop}{de}{orders}"
    for i in range(30):
        greet = greet_word[random.randint(0, len(greet_word) - 1)]
        explain = explain_word[random.randint(0, len(explain_word) - 1)]
        crop = crop_list[random.randint(0, crop_len)]
        de = '的'
        orders = '目'
        text = template.format(greet=greet, explain=explain, crop=crop, de=de, orders=orders)
        data.append([text, '属目', label2id['属目']])

    # 问属科
    template = "{greet}{explain}{crop}{belong}{what4}{genus}"
    for i in range(70):
        greet = greet_word[random.randint(0, len(greet_word) - 1)]
        explain = explain_word[random.randint(0, len(explain_word) - 1)]
        crop = crop_list[random.randint(0, crop_len)]
        belong = belong_word[random.randint(0, len(belong_word) - 1)]
        what4 = what4_word[random.randint(0, len(what4_word) - 1)]
        genus = '科'
        text = template.format(greet=greet, explain=explain, crop=crop, belong=belong, what4=what4, genus=genus)
        data.append([text, '属科', label2id['属科']])

    template = "{greet}{explain}{crop}{de}{genus}"
    for i in range(30):
        greet = greet_word[random.randint(0, len(greet_word) - 1)]
        explain = explain_word[random.randint(0, len(explain_word) - 1)]
        crop = crop_list[random.randint(0, crop_len)]
        de = '的'
        genus = '科'
        text = template.format(greet=greet, explain=explain, crop=crop, de=de, genus=genus)
        data.append([text, '属科', label2id['属科']])

    # 问分布
    template = "{greet}{explain}{crop}{de}{distribution}{area}{where}"
    for i in range(32):
        greet = greet_word[random.randint(0, len(greet_word) - 1)]
        explain = explain_word[random.randint(0, len(explain_word) - 1)]
        crop = crop_list[random.randint(0, crop_len)]
        de = '的'
        distribution = distribution_word[random.randint(0, len(distribution_word) - 1)]
        area = area_word[random.randint(0, len(area_word) - 1)]
        where = where_word[random.randint(0, len(where_word) - 1)]
        text = template.format(greet=greet, explain=explain, crop=crop, de=de, distribution=distribution, area=area,
                               where=where)
        data.append([text, '分布', label2id['分布']])

    template = "{greet}{explain}{crop}{de}{grow}{area2}{where}"
    for i in range(32):
        greet = greet_word[random.randint(0, len(greet_word) - 1)]
        explain = explain_word[random.randint(0, len(explain_word) - 1)]
        crop = crop_list[random.randint(0, crop_len)]
        de = '的'
        grow = grow_word[random.randint(0, len(grow_word) - 1)]
        area2 = area2_word[random.randint(0, len(area2_word) - 1)]
        where = where_word[random.randint(0, len(where_word) - 1)]
        text = template.format(greet=greet, explain=explain, crop=crop, de=de, grow=grow, area2=area2, where=where)
        data.append([text, '分布', label2id['分布']])

    template = "{greet}{explain}{crop}{de}{plant}{area2}{where}"
    for i in range(32):
        greet = greet_word[random.randint(0, len(greet_word) - 1)]
        explain = explain_word[random.randint(0, len(explain_word) - 1)]
        crop = crop_list[random.randint(0, crop_len)]
        de = '的'
        plant = plant_word[random.randint(0, len(plant_word) - 1)]
        area2 = area2_word[random.randint(0, len(area2_word) - 1)]
        where = where_word[random.randint(0, len(where_word) - 1)]
        text = template.format(greet=greet, explain=explain, crop=crop, de=de, plant=plant, area2=area2, where=where)
        data.append([text, '分布', label2id['分布']])

    template = "{greet}{explain}{plant}{crop}{de}{area2}{where}"
    for i in range(32):
        greet = greet_word[random.randint(0, len(greet_word) - 1)]
        explain = explain_word[random.randint(0, len(explain_word) - 1)]
        crop = crop_list[random.randint(0, crop_len)]
        de = '的'
        plant = plant_word[random.randint(0, len(plant_word) - 1)]
        area2 = area2_word[random.randint(0, len(area2_word) - 1)]
        where = where_word[random.randint(0, len(where_word) - 1)]
        text = template.format(greet=greet, explain=explain, crop=crop, de=de, plant=plant, area2=area2, where=where)
        data.append([text, '分布', label2id['分布']])

    template = "{greet}{explain}{crop}{main}{distribution}{where}"
    for i in range(32):
        greet = greet_word[random.randint(0, len(greet_word) - 1)]
        explain = explain_word[random.randint(0, len(explain_word) - 1)]
        crop = crop_list[random.randint(0, crop_len)]
        main = main_word[random.randint(0, len(main_word) - 1)]
        distribution = distribution_word[random.randint(0, len(distribution_word) - 1)]
        where = where_word[random.randint(0, len(where_word) - 1)]
        text = template.format(greet=greet, explain=explain, crop=crop, main=main, distribution=distribution,
                               where=where)
        data.append([text, '分布', label2id['分布']])

    template = "{greet}{explain}{crop}{main}{distribution2}{where}"
    for i in range(10):
        greet = greet_word[random.randint(0, len(greet_word) - 1)]
        explain = explain_word[random.randint(0, len(explain_word) - 1)]
        crop = crop_list[random.randint(0, crop_len)]
        main = main_word[random.randint(0, len(main_word) - 1)]
        distribution2 = distribution_word[random.randint(0, len(distribution2_word) - 1)]
        where = where_word[random.randint(0, len(where_word) - 1)]
        text = template.format(greet=greet, explain=explain, crop=crop, main=main, distribution2=distribution2,
                               where=where)
        data.append([text, '分布', label2id['分布']])

    template = "{greet}{explain}{crop}{most}{area2}{where}"
    for i in range(32):
        greet = greet_word[random.randint(0, len(greet_word) - 1)]
        explain = explain_word[random.randint(0, len(explain_word) - 1)]
        crop = crop_list[random.randint(0, crop_len)]
        most = most_word[random.randint(0, len(most_word) - 1)]
        area2 = area2_word[random.randint(0, len(area2_word) - 1)]
        where = where_word[random.randint(0, len(where_word) - 1)]
        text = template.format(greet=greet, explain=explain, crop=crop, most=most, area2=area2, where=where)
        data.append([text, '分布', label2id['分布']])

    # 问颜色分类
    template = "{greet}{explain}{crop}{shi}{color}{dema}"
    for i in range(20):
        greet = greet_word[random.randint(0, len(greet_word) - 1)]
        explain = explain_word[random.randint(0, len(explain_word) - 1)]
        crop = crop_list[random.randint(0, crop_len)]
        shi = '是'
        color = color_word[random.randint(0, len(color_word) - 1)]
        dema = '的吗'
        text = template.format(greet=greet, explain=explain, crop=crop, color=color, shi=shi, dema=dema)
        data.append([text, '颜色分类', label2id['颜色分类']])

    template = "{greet}{explain}{crop}{de}{color2}"
    for i in range(20):
        greet = greet_word[random.randint(0, len(greet_word) - 1)]
        explain = explain_word[random.randint(0, len(explain_word) - 1)]
        crop = crop_list[random.randint(0, crop_len)]
        color2 = color2_word[random.randint(0, len(color2_word) - 1)]
        de = '的'
        text = template.format(greet=greet, explain=explain, crop=crop, color2=color2, de=de)
        data.append([text, '颜色分类', label2id['颜色分类']])

    template = "{greet}{explain}{crop}{de}{color2}{have10}{num}"
    for i in range(20):
        greet = greet_word[random.randint(0, len(greet_word) - 1)]
        explain = explain_word[random.randint(0, len(explain_word) - 1)]
        crop = crop_list[random.randint(0, crop_len)]
        color2 = color2_word[random.randint(0, len(color2_word) - 1)]
        de = '的'
        have10 = have10_word[random.randint(0, len(have10_word) - 1)]
        num = num_word[random.randint(0, len(num_word) - 1)]
        text = template.format(greet=greet, explain=explain, crop=crop, de=de, color2=color2, have10=have10, num=num)
        data.append([text, '颜色分类', label2id['颜色分类']])

    template = "{greet}{explain}{crop}{de}{color2}{have9}{what}"
    for i in range(20):
        greet = greet_word[random.randint(0, len(greet_word) - 1)]
        explain = explain_word[random.randint(0, len(explain_word) - 1)]
        crop = crop_list[random.randint(0, crop_len)]
        color2 = color2_word[random.randint(0, len(color2_word) - 1)]
        de = '的'
        have9 = have9_word[random.randint(0, len(have9_word) - 1)]
        what = what_word[random.randint(0, len(what_word) - 1)]
        text = template.format(greet=greet, explain=explain, crop=crop, de=de, color2=color2, have9=have9, what=what)
        data.append([text, '颜色分类', label2id['颜色分类']])

    template = "{greet}{explain}{crop}{an}{color2}{how2}{classify2}"
    for i in range(20):
        greet = greet_word[random.randint(0, len(greet_word) - 1)]
        explain = explain_word[random.randint(0, len(explain_word) - 1)]
        crop = crop_list[random.randint(0, crop_len)]
        an = '按'
        color2 = color2_word[random.randint(0, len(color2_word) - 1)]
        how2 = how2_word[random.randint(0, len(how2_word) - 1)]
        classify2 = classify2_word[random.randint(0, len(classify2_word) - 1)]
        text = template.format(greet=greet, explain=explain, crop=crop, an=an, color2=color2, how2=how2,
                               classify2=classify2)
        data.append([text, '颜色分类', label2id['颜色分类']])

    # 问开花季节
    template = "{greet}{explain}{crop}{zai}{what5}{season}{flower}"
    for i in range(50):
        greet = greet_word[random.randint(0, len(greet_word) - 1)]
        explain = explain_word[random.randint(0, len(explain_word) - 1)]
        crop = crop_list[random.randint(0, crop_len)]
        zai = '在'
        what5 = what5_word[random.randint(0, len(what5_word) - 1)]
        season = season_word[random.randint(0, len(season_word) - 1)]
        flower = flower_word[random.randint(0, len(flower_word) - 1)]
        text = template.format(greet=greet, explain=explain, crop=crop, zai=zai, what5=what5, season=season,
                               flower=flower)
        data.append([text, '开花季节', label2id['开花季节']])

    template = "{greet}{explain}{crop}{de}{flower2}{zai}{what5}{season}"
    for i in range(50):
        greet = greet_word[random.randint(0, len(greet_word) - 1)]
        explain = explain_word[random.randint(0, len(explain_word) - 1)]
        crop = crop_list[random.randint(0, crop_len)]
        de = '的'
        zai = '在'
        what5 = what5_word[random.randint(0, len(what5_word) - 1)]
        season = season_word[random.randint(0, len(season_word) - 1)]
        flower2 = flower2_word[random.randint(0, len(flower2_word) - 1)]
        text = template.format(greet=greet, explain=explain, crop=crop, de=de, zai=zai, what5=what5, season=season,
                               flower2=flower2)
        data.append([text, '开花季节', label2id['开花季节']])

    # 问光照需求
    template = "{greet}{explain}{crop}{de}{sun}{need2}"
    for i in range(25):
        greet = greet_word[random.randint(0, len(greet_word) - 1)]
        explain = explain_word[random.randint(0, len(explain_word) - 1)]
        crop = crop_list[random.randint(0, crop_len)]
        de = '的'
        sun = sun_word[random.randint(0, len(sun_word) - 1)]
        need2 = need2_word[random.randint(0, len(need2_word) - 1)]
        text = template.format(greet=greet, explain=explain, crop=crop, de=de, sun=sun, need2=need2)
        data.append([text, '光照需求', label2id['光照需求']])

    template = "{greet}{explain}{crop}{de}{sun}{need2}{have9}{what}"
    for i in range(25):
        greet = greet_word[random.randint(0, len(greet_word) - 1)]
        explain = explain_word[random.randint(0, len(explain_word) - 1)]
        crop = crop_list[random.randint(0, crop_len)]
        de = '的'
        sun = sun_word[random.randint(0, len(sun_word) - 1)]
        need2 = need2_word[random.randint(0, len(need2_word) - 1)]
        have9 = have9_word[random.randint(0, len(have9_word) - 1)]
        what = what_word[random.randint(0, len(what_word) - 1)]
        text = template.format(greet=greet, explain=explain, crop=crop, de=de, sun=sun, need2=need2, have9=have9,
                               what=what)
        data.append([text, '光照需求', label2id['光照需求']])

    template = "{greet}{explain}{sun}{face}{crop}{grow2}{de}{yingx}"
    for i in range(25):
        greet = greet_word[random.randint(0, len(greet_word) - 1)]
        explain = explain_word[random.randint(0, len(explain_word) - 1)]
        crop = crop_list[random.randint(0, crop_len)]
        de = '的'
        sun = sun_word[random.randint(0, len(sun_word) - 1)]
        face = face_word[random.randint(0, len(face_word) - 1)]
        grow2 = grow2_word[random.randint(0, len(grow2_word) - 1)]
        yingx = '影响'
        text = template.format(greet=greet, explain=explain, crop=crop, de=de, sun=sun, face=face, grow2=grow2,
                               yingx=yingx)
        data.append([text, '光照需求', label2id['光照需求']])

    template = "{greet}{explain}{crop}{face}{sun}{special}{de}{need2}"
    for i in range(25):
        greet = greet_word[random.randint(0, len(greet_word) - 1)]
        explain = explain_word[random.randint(0, len(explain_word) - 1)]
        crop = crop_list[random.randint(0, crop_len)]
        de = '的'
        sun = sun_word[random.randint(0, len(sun_word) - 1)]
        face = face_word[random.randint(0, len(face_word) - 1)]
        special = special_word[random.randint(0, len(special_word) - 1)]
        need2 = need2_word[random.randint(0, len(need2_word) - 1)]
        text = template.format(greet=greet, explain=explain, crop=crop, de=de, sun=sun, face=face, special=special,
                               need2=need2)
        data.append([text, '光照需求', label2id['光照需求']])

    # 问培育难度
    template = "{greet}{explain}{crop}{de}{plant}{difficulty}"
    for i in range(20):
        greet = greet_word[random.randint(0, len(greet_word) - 1)]
        explain = explain_word[random.randint(0, len(explain_word) - 1)]
        crop = crop_list[random.randint(0, crop_len)]
        de = '的'
        plant = plant_word[random.randint(0, len(plant_word) - 1)]
        difficulty = difficulty_word[random.randint(0, len(difficulty_word) - 1)]
        text = template.format(greet=greet, explain=explain, crop=crop, de=de, plant=plant, difficulty=difficulty)
        data.append([text, '培育难度', label2id['培育难度']])

    template = "{greet}{explain}{plant}{crop}{de}{degree}"
    for i in range(20):
        greet = greet_word[random.randint(0, len(greet_word) - 1)]
        explain = explain_word[random.randint(0, len(explain_word) - 1)]
        plant = plant_word[random.randint(0, len(plant_word) - 1)]
        crop = crop_list[random.randint(0, crop_len)]
        de = '的'
        degree = degree_word[random.randint(0, len(degree_word) - 1)]
        text = template.format(greet=greet, explain=explain, crop=crop, de=de, plant=plant, degree=degree)
        data.append([text, '培育难度', label2id['培育难度']])

    template = "{greet}{explain}{plant}{crop}{may}{than}{degree2}"
    for i in range(20):
        greet = greet_word[random.randint(0, len(greet_word) - 1)]
        explain = explain_word[random.randint(0, len(explain_word) - 1)]
        plant = plant_word[random.randint(0, len(plant_word) - 1)]
        crop = crop_list[random.randint(0, crop_len)]
        may = may_word[random.randint(0, len(may_word) - 1)]
        than = than_word[random.randint(0, len(than_word) - 1)]
        degree2 = degree2_word[random.randint(0, len(degree2_word) - 1)]
        text = template.format(greet=greet, explain=explain, crop=crop, may=may, than=than, plant=plant,
                               degree2=degree2)
        data.append([text, '培育难度', label2id['培育难度']])

    template = "{greet}{explain}{crop}{may}{than}{degree2}{plant}"
    for i in range(20):
        greet = greet_word[random.randint(0, len(greet_word) - 1)]
        explain = explain_word[random.randint(0, len(explain_word) - 1)]
        plant = plant_word[random.randint(0, len(plant_word) - 1)]
        crop = crop_list[random.randint(0, crop_len)]
        may = may_word[random.randint(0, len(may_word) - 1)]
        than = than_word[random.randint(0, len(than_word) - 1)]
        degree2 = degree2_word[random.randint(0, len(degree2_word) - 1)]
        text = template.format(greet=greet, explain=explain, crop=crop, may=may, than=than, plant=plant,
                               degree2=degree2)
        data.append([text, '培育难度', label2id['培育难度']])

    template = "{greet}{explain}{crop}{degree3}{plant}"
    for i in range(20):
        greet = greet_word[random.randint(0, len(greet_word) - 1)]
        explain = explain_word[random.randint(0, len(explain_word) - 1)]
        crop = crop_list[random.randint(0, crop_len)]
        degree3 = degree3_word[random.randint(0, len(degree3_word) - 1)]
        plant = plant_word[random.randint(0, len(plant_word) - 1)]
        text = template.format(greet=greet, explain=explain, crop=crop, degree3=degree3, plant=plant)
        data.append([text, '培育难度', label2id['培育难度']])

    # 问适宜温度
    template = "{greet}{explain}{crop}{de}{suit2}{temperature2}"
    for i in range(25):
        greet = greet_word[random.randint(0, len(greet_word) - 1)]
        explain = explain_word[random.randint(0, len(explain_word) - 1)]
        crop = crop_list[random.randint(0, crop_len)]
        de = '的'
        suit2 = suit2_word[random.randint(0, len(suit2_word) - 1)]
        temperature2 = temperature2_word[random.randint(0, len(temperature2_word) - 1)]
        text = template.format(greet=greet, explain=explain, crop=crop, de=de, suit2=suit2, temperature2=temperature2)
        data.append([text, '适宜温度', label2id['适宜温度']])

    template = "{greet}{explain}{crop}{face}{temperature2}{de}{need3}"
    for i in range(25):
        greet = greet_word[random.randint(0, len(greet_word) - 1)]
        explain = explain_word[random.randint(0, len(explain_word) - 1)]
        crop = crop_list[random.randint(0, crop_len)]
        de = '的'
        face = face_word[random.randint(0, len(face_word) - 1)]
        temperature2 = temperature2_word[random.randint(0, len(temperature2_word) - 1)]
        need3 = need3_word[random.randint(0, len(need3_word) - 1)]
        text = template.format(greet=greet, explain=explain, crop=crop, de=de, face=face, temperature2=temperature2,
                               need3=need3)
        data.append([text, '适宜温度', label2id['适宜温度']])

    template = "{greet}{explain}{crop}{plant}{de}{suit2}{temperature2}"
    for i in range(25):
        greet = greet_word[random.randint(0, len(greet_word) - 1)]
        explain = explain_word[random.randint(0, len(explain_word) - 1)]
        crop = crop_list[random.randint(0, crop_len)]
        de = '的'
        plant = plant_word[random.randint(0, len(plant_word) - 1)]
        temperature2 = temperature2_word[random.randint(0, len(temperature2_word) - 1)]
        suit2 = suit2_word[random.randint(0, len(suit2_word) - 1)]
        text = template.format(greet=greet, explain=explain, crop=crop, de=de, plant=plant, temperature2=temperature2,
                               suit2=suit2)
        data.append([text, '适宜温度', label2id['适宜温度']])

    template = "{greet}{explain}{than}{suit3}{crop}{grow}{de}{temperature2}"
    for i in range(25):
        greet = greet_word[random.randint(0, len(greet_word) - 1)]
        explain = explain_word[random.randint(0, len(explain_word) - 1)]
        than = than_word[random.randint(0, len(than_word) - 1)]
        suit3 = suit3_word[random.randint(0, len(suit3_word) - 1)]
        crop = crop_list[random.randint(0, crop_len)]
        grow = grow_word[random.randint(0, len(grow_word) - 1)]
        de = '的'
        temperature2 = temperature2_word[random.randint(0, len(temperature2_word) - 1)]
        text = template.format(greet=greet, explain=explain, than=than, suit3=suit3, crop=crop, grow=grow, de=de,
                               temperature2=temperature2)
        data.append([text, '适宜温度', label2id['适宜温度']])

    template = "{greet}{explain}{plant}{crop}{de}{suit2}{temperature2}"
    for i in range(25):
        greet = greet_word[random.randint(0, len(greet_word) - 1)]
        explain = explain_word[random.randint(0, len(explain_word) - 1)]
        plant = plant_word[random.randint(0, len(plant_word) - 1)]
        suit2 = suit2_word[random.randint(0, len(suit2_word) - 1)]
        crop = crop_list[random.randint(0, crop_len)]
        de = '的'
        temperature2 = temperature2_word[random.randint(0, len(temperature2_word) - 1)]
        text = template.format(greet=greet, explain=explain, plant=plant, suit2=suit2, crop=crop, de=de,
                               temperature2=temperature2)
        data.append([text, '适宜温度', label2id['适宜温度']])

    template = "{greet}{explain}{crop}{zai}{what}{temperature2}{xia}{can}{suit}{grow}"
    for i in range(25):
        greet = greet_word[random.randint(0, len(greet_word) - 1)]
        explain = explain_word[random.randint(0, len(explain_word) - 1)]
        crop = crop_list[random.randint(0, crop_len)]
        zai = '在'
        what = what_word[random.randint(0, len(what_word) - 1)]
        temperature2 = temperature2_word[random.randint(0, len(temperature2_word) - 1)]
        xia = '下'
        can = can_word[random.randint(0, len(can_word) - 1)]
        suit = suit_word[random.randint(0, len(suit_word) - 1)]
        grow = grow_word[random.randint(0, len(grow_word) - 1)]
        text = template.format(greet=greet, explain=explain, crop=crop, zai=zai, what=what, temperature2=temperature2,
                               xia=xia, can=can, suit=suit, grow=grow)
        data.append([text, '适宜温度', label2id['适宜温度']])

    template = "{greet}{explain}{crop}{zai}{what}{temperature2}{xia}{cannot2}{suit}{grow}"
    for i in range(25):
        greet = greet_word[random.randint(0, len(greet_word) - 1)]
        explain = explain_word[random.randint(0, len(explain_word) - 1)]
        crop = crop_list[random.randint(0, crop_len)]
        zai = '在'
        what = what_word[random.randint(0, len(what_word) - 1)]
        temperature2 = temperature2_word[random.randint(0, len(temperature2_word) - 1)]
        xia = '下'
        cannot2 = cannot2_word[random.randint(0, len(cannot2_word) - 1)]
        suit = suit_word[random.randint(0, len(suit_word) - 1)]
        grow = grow_word[random.randint(0, len(grow_word) - 1)]
        text = template.format(greet=greet, explain=explain, crop=crop, zai=zai, what=what, temperature2=temperature2,
                               xia=xia, cannot2=cannot2, suit=suit, grow=grow)
        data.append([text, '适宜温度', label2id['适宜温度']])

    template = "{greet}{explain}{crop}{zai}{than}{temperature3}{condition}{xia}{can}{grow}{ma}"
    for i in range(25):
        greet = greet_word[random.randint(0, len(greet_word) - 1)]
        explain = explain_word[random.randint(0, len(explain_word) - 1)]
        crop = crop_list[random.randint(0, crop_len)]
        zai = '在'
        than = than_word[random.randint(0, len(than_word) - 1)]
        temperature3 = temperature3_word[random.randint(0, len(temperature3_word) - 1)]
        condition = condition_word[random.randint(0, len(condition_word) - 1)]
        xia = '下'
        can = can_word[random.randint(0, len(can_word) - 1)]
        grow = grow_word[random.randint(0, len(grow_word) - 1)]
        ma = '吗'
        text = template.format(greet=greet, explain=explain, crop=crop, zai=zai, than=than, temperature3=temperature3,
                               condition=condition, xia=xia, can=can, ma=ma, grow=grow)
        data.append([text, '适宜温度', label2id['适宜温度']])

    # 问酸碱范围
    template = "{greet}{explain}{crop}{de}{suit2}{acidBase}{area3}"
    for i in range(25):
        greet = greet_word[random.randint(0, len(greet_word) - 1)]
        explain = explain_word[random.randint(0, len(explain_word) - 1)]
        crop = crop_list[random.randint(0, crop_len)]
        de = '的'
        suit2 = suit2_word[random.randint(0, len(suit2_word) - 1)]
        acidBase = acidBase_word[random.randint(0, len(acidBase_word) - 1)]
        area3 = area3_word[random.randint(0, len(area3_word) - 1)]
        text = template.format(greet=greet, explain=explain, acidBase=acidBase, area3=area3, suit2=suit2, crop=crop,
                               de=de)
        data.append([text, '酸碱范围', label2id['酸碱范围']])

    template = "{greet}{explain}{crop}{de}{suit2}{acidBase}{area3}{shi}{what2}"
    for i in range(25):
        greet = greet_word[random.randint(0, len(greet_word) - 1)]
        explain = explain_word[random.randint(0, len(explain_word) - 1)]
        crop = crop_list[random.randint(0, crop_len)]
        de = '的'
        suit2 = suit2_word[random.randint(0, len(suit2_word) - 1)]
        acidBase = acidBase_word[random.randint(0, len(acidBase_word) - 1)]
        area3 = area3_word[random.randint(0, len(area3_word) - 1)]
        shi = '是'
        what2 = what2_word[random.randint(0, len(what2_word) - 1)]
        text = template.format(greet=greet, explain=explain, acidBase=acidBase, area3=area3, suit2=suit2, crop=crop,
                               de=de, shi=shi, what2=what2)
        data.append([text, '酸碱范围', label2id['酸碱范围']])

    template = "{greet}{explain}{crop}{acidBase2}"
    for i in range(5):
        greet = greet_word[random.randint(0, len(greet_word) - 1)]
        explain = explain_word[random.randint(0, len(explain_word) - 1)]
        crop = crop_list[random.randint(0, crop_len)]
        acidBase2 = acidBase2_word[random.randint(0, len(acidBase2_word) - 1)]
        text = template.format(greet=greet, explain=explain, acidBase2=acidBase2, crop=crop)
        data.append([text, '酸碱范围', label2id['酸碱范围']])

    template = "{greet}{explain}{crop}{main}{grow}{de}{land}{acidBase}{area3}{at}"
    for i in range(25):
        greet = greet_word[random.randint(0, len(greet_word) - 1)]
        explain = explain_word[random.randint(0, len(explain_word) - 1)]
        crop = crop_list[random.randint(0, crop_len)]
        main = main_word[random.randint(0, len(main_word) - 1)]
        grow = grow_word[random.randint(0, len(grow_word) - 1)]
        de = '的'
        land = land_word[random.randint(0, len(land_word) - 1)]
        acidBase = acidBase_word[random.randint(0, len(acidBase_word) - 1)]
        area3 = area3_word[random.randint(0, len(area3_word) - 1)]
        at = at_word[random.randint(0, len(at_word) - 1)]
        text = template.format(greet=greet, explain=explain, crop=crop, main=main, grow=grow, de=de, land=land,
                               acidBase=acidBase, area3=area3, at=at)
        data.append([text, '酸碱范围', label2id['酸碱范围']])

    template = "{greet}{explain}{than}{suit3}{crop}{grow}{de}{acidBase}{area3}{at}"
    for i in range(25):
        greet = greet_word[random.randint(0, len(greet_word) - 1)]
        explain = explain_word[random.randint(0, len(explain_word) - 1)]
        crop = crop_list[random.randint(0, crop_len)]
        than = than_word[random.randint(0, len(than_word) - 1)]
        suit3 = suit3_word[random.randint(0, len(suit3_word) - 1)]
        grow = grow_word[random.randint(0, len(grow_word) - 1)]
        de = '的'
        acidBase = acidBase_word[random.randint(0, len(acidBase_word) - 1)]
        area3 = area3_word[random.randint(0, len(area3_word) - 1)]
        at = at_word[random.randint(0, len(at_word) - 1)]
        text = template.format(greet=greet, explain=explain, crop=crop, than=than, suit3=suit3, grow=grow, de=de,
                               acidBase=acidBase, area3=area3, at=at)
        data.append([text, '酸碱范围', label2id['酸碱范围']])

    # 问作物特征
    template = "{greet}{explain}{crop}{de}{extrude}{character4}{describe}"
    for i in range(66):
        greet = greet_word[random.randint(0, len(greet_word) - 1)]
        explain = explain_word[random.randint(0, len(explain_word) - 1)]
        crop = crop_list[random.randint(0, crop_len)]
        de = '的'
        extrude = extrude_word[random.randint(0, len(extrude_word) - 1)]
        character4 = character4_word[random.randint(0, len(character4_word) - 1)]
        describe = describe_word[random.randint(0, len(describe_word) - 1)]
        text = template.format(greet=greet, explain=explain, crop=crop, de=de, extrude=extrude, character4=character4,
                               describe=describe)
        data.append([text, '作物特征', label2id['作物特征']])

    template = "{greet}{explain}{crop}{de}{extrude}{character4}{have2}{what}"
    for i in range(66):
        greet = greet_word[random.randint(0, len(greet_word) - 1)]
        explain = explain_word[random.randint(0, len(explain_word) - 1)]
        crop = crop_list[random.randint(0, crop_len)]
        de = '的'
        extrude = extrude_word[random.randint(0, len(extrude_word) - 1)]
        character4 = character4_word[random.randint(0, len(character4_word) - 1)]
        have2 = have2_word[random.randint(0, len(have2_word) - 1)]
        what = what_word[random.randint(0, len(what_word) - 1)]
        text = template.format(greet=greet, explain=explain, crop=crop, de=de, extrude=extrude, character4=character4,
                               have2=have2, what=what)
        data.append([text, '作物特征', label2id['作物特征']])

    template = "{greet}{explain}{crop}{surface}{have2}{what}{extrude}{character4}"
    for i in range(66):
        greet = greet_word[random.randint(0, len(greet_word) - 1)]
        explain = explain_word[random.randint(0, len(explain_word) - 1)]
        crop = crop_list[random.randint(0, crop_len)]
        surface = surface_word[random.randint(0, len(surface_word) - 1)]
        have2 = have2_word[random.randint(0, len(have2_word) - 1)]
        what = what_word[random.randint(0, len(what_word) - 1)]
        extrude = extrude_word[random.randint(0, len(extrude_word) - 1)]
        character4 = character4_word[random.randint(0, len(character4_word) - 1)]
        text = template.format(greet=greet, explain=explain, crop=crop, surface=surface, extrude=extrude,
                               character4=character4, have2=have2, what=what)
        data.append([text, '作物特征', label2id['作物特征']])

    # 问繁殖方式
    template = "{greet}{explain}{crop}{de}{breed}{way3}"
    for i in range(20):
        greet = greet_word[random.randint(0, len(greet_word) - 1)]
        explain = explain_word[random.randint(0, len(explain_word) - 1)]
        crop = crop_list[random.randint(0, crop_len)]
        de = '的'
        breed = breed_word[random.randint(0, len(breed_word) - 1)]
        way3 = way3_word[random.randint(0, len(way3_word) - 1)]
        text = template.format(greet=greet, explain=explain, crop=crop, de=de, breed=breed, way3=way3)
        data.append([text, '繁殖方式', label2id['繁殖方式']])

    template = "{greet}{explain}{crop}{de}{breed}{way3}{have2}{what2}"
    for i in range(20):
        greet = greet_word[random.randint(0, len(greet_word) - 1)]
        explain = explain_word[random.randint(0, len(explain_word) - 1)]
        crop = crop_list[random.randint(0, crop_len)]
        de = '的'
        breed = breed_word[random.randint(0, len(breed_word) - 1)]
        way3 = way3_word[random.randint(0, len(way3_word) - 1)]
        have2 = have2_word[random.randint(0, len(have2_word) - 1)]
        what2 = what2_word[random.randint(0, len(what2_word) - 1)]
        text = template.format(greet=greet, explain=explain, crop=crop, de=de, breed=breed, way3=way3, have2=have2,
                               what2=what2)
        data.append([text, '繁殖方式', label2id['繁殖方式']])

    template = "{greet}{explain}{crop}{shi}{use3}{what2}{breed}{de}"
    for i in range(20):
        greet = greet_word[random.randint(0, len(greet_word) - 1)]
        explain = explain_word[random.randint(0, len(explain_word) - 1)]
        crop = crop_list[random.randint(0, crop_len)]
        shi = '是'
        de = '的'
        breed = breed_word[random.randint(0, len(breed_word) - 1)]
        use3 = use3_word[random.randint(0, len(use3_word) - 1)]
        what2 = what2_word[random.randint(0, len(what2_word) - 1)]
        text = template.format(greet=greet, explain=explain, crop=crop, shi=shi, breed=breed, use3=use3, de=de,
                               what2=what2)
        data.append([text, '繁殖方式', label2id['繁殖方式']])

    template = "{greet}{explain}{crop}{belong2}{what2}{breed}{way3}{de}"
    for i in range(20):
        greet = greet_word[random.randint(0, len(greet_word) - 1)]
        explain = explain_word[random.randint(0, len(explain_word) - 1)]
        crop = crop_list[random.randint(0, crop_len)]
        belong2 = belong2_word[random.randint(0, len(belong2_word) - 1)]
        de = '的'
        breed = breed_word[random.randint(0, len(breed_word) - 1)]
        way3 = way3_word[random.randint(0, len(way3_word) - 1)]
        what2 = what2_word[random.randint(0, len(what2_word) - 1)]
        text = template.format(greet=greet, explain=explain, crop=crop, belong2=belong2, breed=breed, way3=way3, de=de,
                               what2=what2)
        data.append([text, '繁殖方式', label2id['繁殖方式']])

    template = "{greet}{explain}{crop}{shi}{how2}{breed}{de}"
    for i in range(20):
        greet = greet_word[random.randint(0, len(greet_word) - 1)]
        explain = explain_word[random.randint(0, len(explain_word) - 1)]
        crop = crop_list[random.randint(0, crop_len)]
        shi = '是'
        de = '的'
        breed = breed_word[random.randint(0, len(breed_word) - 1)]
        how2 = how2_word[random.randint(0, len(how2_word) - 1)]
        text = template.format(greet=greet, explain=explain, crop=crop, shi=shi, breed=breed, how2=how2, de=de)
        data.append([text, '繁殖方式', label2id['繁殖方式']])

    template = "{greet}{explain}{crop}{breed2}"
    for i in range(5):
        greet = greet_word[random.randint(0, len(greet_word) - 1)]
        explain = explain_word[random.randint(0, len(explain_word) - 1)]
        crop = crop_list[random.randint(0, crop_len)]
        breed2 = breed2_word[random.randint(0, len(breed2_word) - 1)]
        text = template.format(greet=greet, explain=explain, crop=crop, breed2=breed2)
        data.append([text, '繁殖方式', label2id['繁殖方式']])

    # 问开花形态
    template = "{greet}{explain}{crop}{de}{flower3}{character5}"
    for i in range(50):
        greet = greet_word[random.randint(0, len(greet_word) - 1)]
        explain = explain_word[random.randint(0, len(explain_word) - 1)]
        crop = crop_list[random.randint(0, crop_len)]
        de = '的'
        flower3 = flower3_word[random.randint(0, len(flower3_word) - 1)]
        character5 = character5_word[random.randint(0, len(character5_word) - 1)]
        text = template.format(greet=greet, explain=explain, crop=crop, de=de, flower3=flower3, character5=character5)
        data.append([text, '开花形态', label2id['开花形态']])

    template = "{greet}{explain}{crop}{flower3}{what2}{character5}"
    for i in range(50):
        greet = greet_word[random.randint(0, len(greet_word) - 1)]
        explain = explain_word[random.randint(0, len(explain_word) - 1)]
        crop = crop_list[random.randint(0, crop_len)]
        flower3 = flower3_word[random.randint(0, len(flower3_word) - 1)]
        what2 = what2_word[random.randint(0, len(what2_word) - 1)]
        character5 = character5_word[random.randint(0, len(character5_word) - 1)]
        text = template.format(greet=greet, explain=explain, crop=crop, what2=what2, flower3=flower3,
                               character5=character5)
        data.append([text, '开花形态', label2id['开花形态']])

    template = "{greet}{explain}{crop}{flower4}"
    for i in range(25):
        greet = greet_word[random.randint(0, len(greet_word) - 1)]
        explain = explain_word[random.randint(0, len(explain_word) - 1)]
        crop = crop_list[random.randint(0, crop_len)]
        flower4 = flower4_word[random.randint(0, len(flower4_word) - 1)]
        text = template.format(greet=greet, explain=explain, crop=crop, flower4=flower4)
        data.append([text, '开花形态', label2id['开花形态']])

    # 病害
    # 问别名
    ask_alias(disease_list, disease_len)

    # 问简介
    ask_define(disease_list, disease_len)

    # 问病因
    template = "{greet}{explain}{disease}{lead}{de}{cause}"
    for i in range(20):
        greet = greet_word[random.randint(0, len(greet_word) - 1)]
        explain = explain_word[random.randint(0, len(explain_word) - 1)]
        disease = disease_list[random.randint(0, disease_len)]
        lead = lead_word[random.randint(0, len(lead_word) - 1)]
        if (i % 5 == 0):
            lead = ''
        de = '的'
        cause = cause_word[random.randint(0, len(cause_word) - 1)]
        text = template.format(greet=greet, explain=explain, de=de, lead=lead, disease=disease, cause=cause)
        data.append([text, '病因', label2id['病因']])

    template = "{greet}{explain}{why}{hui}{lead}{disease}"
    for i in range(20):
        greet = greet_word[random.randint(0, len(greet_word) - 1)]
        explain = explain_word[random.randint(0, len(explain_word) - 1)]
        why = why_word[random.randint(0, len(why_word) - 1)]
        hui = '会'
        if (i % 5 == 0):
            hui = ''
        disease = disease_list[random.randint(0, disease_len)]
        lead = lead_word[random.randint(0, len(lead_word) - 1)]
        text = template.format(greet=greet, explain=explain, why=why, hui=hui, lead=lead, disease=disease)
        data.append([text, '病因', label2id['病因']])

    template = "{greet}{explain}{how2}{hui}{lead}{disease}{de}"
    for i in range(20):
        greet = greet_word[random.randint(0, len(greet_word) - 1)]
        explain = explain_word[random.randint(0, len(explain_word) - 1)]
        how2 = how2_word[random.randint(0, len(how2_word) - 1)]
        hui = '会'
        if (i % 5 == 0):
            hui = ''
        disease = disease_list[random.randint(0, disease_len)]
        lead = lead_word[random.randint(0, len(lead_word) - 1)]
        de = '的'
        if (i % 2 == 0):
            de = ''
        text = template.format(greet=greet, explain=explain, how2=how2, hui=hui, lead=lead, disease=disease,
                               de=de)
        data.append([text, '病因', label2id['病因']])

    template = "{greet}{explain}{disease}{shi}{how2}{lead}{de}"
    for i in range(20):
        greet = greet_word[random.randint(0, len(greet_word) - 1)]
        explain = explain_word[random.randint(0, len(explain_word) - 1)]
        how2 = how2_word[random.randint(0, len(how2_word) - 1)]
        shi = '是'
        disease = disease_list[random.randint(0, disease_len)]
        lead = lead_word[random.randint(0, len(lead_word) - 1)]
        de = '的'
        text = template.format(greet=greet, explain=explain, how2=how2, shi=shi, lead=lead, disease=disease,
                               de=de)
        data.append([text, '病因', label2id['病因']])

    template = "{greet}{explain}{disease}{shi}{what2}{cause}"
    for i in range(20):
        greet = greet_word[random.randint(0, len(greet_word) - 1)]
        explain = explain_word[random.randint(0, len(explain_word) - 1)]
        shi = '是'
        disease = disease_list[random.randint(0, disease_len)]
        what2 = what2_word[random.randint(0, len(what2_word) - 1)]
        cause = cause_word[random.randint(0, len(cause_word) - 1)]
        text = template.format(greet=greet, explain=explain, shi=shi, what2=what2, disease=disease, cause=cause)
        data.append([text, '病因', label2id['病因']])

    # 问防治措施
    ask_preventWay(disease_list, disease_len)

    # 问传播途径与发病条件
    ask_spread(disease_list, disease_len)

    # 问为害对象
    ask_harmObject(disease_list, disease_len)

    # 问为害部位
    ask_harmLocation(disease_list, disease_len)

    # 问为害症状
    ask_harmSymptom(disease_list, disease_len)

    # 问区别
    ask_difference(disease_list, disease_len)

    # 虫害
    # 别名
    ask_alias(pest_list, pest_len)

    # 问简介
    ask_define(pest_list, pest_len)

    # 问病因
    template = "{greet}{explain}{have4}{pest}{de}{cause}"
    for i in range(20):
        greet = greet_word[random.randint(0, len(greet_word) - 1)]
        explain = explain_word[random.randint(0, len(explain_word) - 1)]
        pest = pest_list[random.randint(0, pest_len)]
        have4 = have4_word[random.randint(0, len(have4_word) - 1)]
        de = '的'
        cause = cause_word[random.randint(0, len(cause_word) - 1)]
        text = template.format(greet=greet, explain=explain, de=de, have4=have4, pest=pest, cause=cause)
        data.append([text, '病因', label2id['病因']])

    template = "{greet}{explain}{why}{have}{pest}"
    for i in range(20):
        greet = greet_word[random.randint(0, len(greet_word) - 1)]
        explain = explain_word[random.randint(0, len(explain_word) - 1)]
        why = why_word[random.randint(0, len(why_word) - 1)]
        have = have_word[random.randint(0, len(have_word) - 1)]
        pest = pest_list[random.randint(0, pest_len)]
        text = template.format(greet=greet, explain=explain, why=why, have=have, pest=pest)
        data.append([text, '病因', label2id['病因']])

    template = "{greet}{explain}{why}{crop}{shang}{have}{pest}"
    for i in range(20):
        greet = greet_word[random.randint(0, len(greet_word) - 1)]
        explain = explain_word[random.randint(0, len(explain_word) - 1)]
        why = why_word[random.randint(0, len(why_word) - 1)]
        crop = crop_list[random.randint(0, crop_len)]
        shang = '上'
        have = have_word[random.randint(0, len(have_word) - 1)]
        pest = pest_list[random.randint(0, pest_len)]
        text = template.format(greet=greet, explain=explain, why=why, crop=crop, shang=shang, have=have, pest=pest)
        data.append([text, '病因', label2id['病因']])

    template = "{greet}{explain}{how2}{hui}{have4}{pest}{de}"
    for i in range(20):
        greet = greet_word[random.randint(0, len(greet_word) - 1)]
        explain = explain_word[random.randint(0, len(explain_word) - 1)]
        how2 = how2_word[random.randint(0, len(how2_word) - 1)]
        hui = '会'
        if (i % 5 == 0):
            hui = ''
        pest = pest_list[random.randint(0, pest_len)]
        have4 = have4_word[random.randint(0, len(have4_word) - 1)]
        de = '的'
        if (i % 2 == 0):
            de = ''
        text = template.format(greet=greet, explain=explain, how2=how2, hui=hui, have4=have4, pest=pest,
                               de=de)
        data.append([text, '病因', label2id['病因']])

    template = "{greet}{explain}{pest}{shi}{how2}{have4}{de}"
    for i in range(20):
        greet = greet_word[random.randint(0, len(greet_word) - 1)]
        explain = explain_word[random.randint(0, len(explain_word) - 1)]
        how2 = how2_word[random.randint(0, len(how2_word) - 1)]
        shi = '是'
        pest = pest_list[random.randint(0, pest_len)]
        have4 = have4_word[random.randint(0, len(have4_word) - 1)]
        de = '的'
        text = template.format(greet=greet, explain=explain, how2=how2, shi=shi, have4=have4, pest=pest,
                               de=de)
        data.append([text, '病因', label2id['病因']])

    template = "{greet}{explain}{have4}{pest}{shi}{what2}{cause}"
    for i in range(20):
        greet = greet_word[random.randint(0, len(greet_word) - 1)]
        explain = explain_word[random.randint(0, len(explain_word) - 1)]
        shi = '是'
        have4 = have4_word[random.randint(0, len(have4_word) - 1)]
        pest = pest_list[random.randint(0, pest_len)]
        what2 = what2_word[random.randint(0, len(what2_word) - 1)]
        cause = cause_word[random.randint(0, len(cause_word) - 1)]
        text = template.format(greet=greet, explain=explain, have4=have4, shi=shi, what2=what2, pest=pest,
                               cause=cause)
        data.append([text, '病因', label2id['病因']])

    # 问防治措施
    ask_preventWay(pest_list, pest_len)

    # 问传播途径与发病条件
    ask_spread(pest_list, pest_len)

    # 问为害对象
    ask_harmObject(pest_list, pest_len)

    # 问为害部位
    ask_harmLocation(pest_list, pest_len)

    # 问为害症状
    ask_harmSymptom(pest_list, pest_len)

    # 问生活习性
    template = "{greet}{explain}{pest}{habits}"
    for i in range(60):
        greet = greet_word[random.randint(0, len(greet_word) - 1)]
        explain = explain_word[random.randint(0, len(explain_word) - 1)]
        pest = pest_list[random.randint(0, pest_len)]
        habits = habits_word[random.randint(0, len(habits_word) - 1)]
        text = template.format(greet=greet, explain=explain, pest=pest, habits=habits)
        data.append([text, '生活习性', label2id['生活习性']])

    template = "{greet}{explain}{pest}{de}{habits2}{have2}{what}"
    for i in range(28):
        greet = greet_word[random.randint(0, len(greet_word) - 1)]
        explain = explain_word[random.randint(0, len(explain_word) - 1)]
        pest = pest_list[random.randint(0, pest_len)]
        de = '的'
        habits2 = habits2_word[random.randint(0, len(habits2_word) - 1)]
        have2 = have2_word[random.randint(0, len(have2_word) - 1)]
        what = what_word[random.randint(0, len(what_word) - 1)]
        if (i % 2 == 0):
            what = ''
            have2 = ''
        text = template.format(greet=greet, explain=explain, pest=pest, de=de, habits2=habits2, have2=have2, what=what)
        data.append([text, '生活习性', label2id['生活习性']])

    template = "{greet}{explain}{pest}{probably}{what}{time}{appear}"
    for i in range(28):
        greet = greet_word[random.randint(0, len(greet_word) - 1)]
        explain = explain_word[random.randint(0, len(explain_word) - 1)]
        pest = pest_list[random.randint(0, pest_len)]
        probably = probably_word[random.randint(0, len(probably_word) - 1)]
        what = what_word[random.randint(0, len(what_word) - 1)]
        time = time_word[random.randint(0, len(time_word) - 1)]
        appear = appear_word[random.randint(0, len(appear_word) - 1)]
        text = template.format(greet=greet, explain=explain, pest=pest, probably=probably, what=what, time=time,
                               appear=appear)
        data.append([text, '生活习性', label2id['生活习性']])

    template = "{greet}{explain}{pest}{where}{live}{de}"
    for i in range(28):
        greet = greet_word[random.randint(0, len(greet_word) - 1)]
        explain = explain_word[random.randint(0, len(explain_word) - 1)]
        pest = pest_list[random.randint(0, pest_len)]
        where = where_word[random.randint(0, len(where_word) - 1)]
        live = live_word[random.randint(0, len(live_word) - 1)]
        de = '的'
        text = template.format(greet=greet, explain=explain, pest=pest, where=where, live=live, de=de)
        data.append([text, '生活习性', label2id['生活习性']])

    template = "{greet}{explain}{pest}{probably}{what}{time}{none}"
    for i in range(28):
        greet = greet_word[random.randint(0, len(greet_word) - 1)]
        explain = explain_word[random.randint(0, len(explain_word) - 1)]
        pest = pest_list[random.randint(0, pest_len)]
        probably = probably_word[random.randint(0, len(probably_word) - 1)]
        what = what_word[random.randint(0, len(what_word) - 1)]
        time = time_word[random.randint(0, len(time_word) - 1)]
        none = none_word[random.randint(0, len(none_word) - 1)]
        text = template.format(greet=greet, explain=explain, pest=pest, probably=probably, what=what, time=time,
                               none=none)
        data.append([text, '生活习性', label2id['生活习性']])

    template = "{greet}{explain}{pest}{love}{temperature}{ma}"
    for i in range(28):
        greet = greet_word[random.randint(0, len(greet_word) - 1)]
        explain = explain_word[random.randint(0, len(explain_word) - 1)]
        pest = pest_list[random.randint(0, pest_len)]
        love = love_word[random.randint(0, len(love_word) - 1)]
        temperature = temperature_word[random.randint(0, len(temperature_word) - 1)]
        ma = '吗'
        text = template.format(greet=greet, explain=explain, pest=pest, love=love, temperature=temperature, ma=ma)
        data.append([text, '生活习性', label2id['生活习性']])

    # 问形态特征
    template = "{greet}{explain}{pest}{character}"
    for i in range(20):
        greet = greet_word[random.randint(0, len(greet_word) - 1)]
        explain = explain_word[random.randint(0, len(explain_word) - 1)]
        pest = pest_list[random.randint(0, pest_len)]
        character = character_word[random.randint(0, len(character_word) - 1)]
        text = template.format(greet=greet, explain=explain, pest=pest, character=character)
        data.append([text, '形态特征', label2id['形态特征']])

    template = "{greet}{explain}{pest}{de}{character2}{have2}{what}"
    for i in range(54):
        greet = greet_word[random.randint(0, len(greet_word) - 1)]
        explain = explain_word[random.randint(0, len(explain_word) - 1)]
        pest = pest_list[random.randint(0, pest_len)]
        de = '的'
        character2 = character2_word[random.randint(0, len(character2_word) - 1)]
        have2 = have2_word[random.randint(0, len(have2_word) - 1)]
        what = what_word[random.randint(0, len(what_word) - 1)]
        if (i % 2 == 0):
            what = ''
            have2 = ''
        text = template.format(greet=greet, explain=explain, pest=pest, de=de, character2=character2, have2=have2,
                               what=what)
        data.append([text, '形态特征', label2id['形态特征']])

    template = "{greet}{explain}{pest}{have2}{what}{character2}"
    for i in range(54):
        greet = greet_word[random.randint(0, len(greet_word) - 1)]
        explain = explain_word[random.randint(0, len(explain_word) - 1)]
        pest = pest_list[random.randint(0, pest_len)]
        character2 = character2_word[random.randint(0, len(character2_word) - 1)]
        have2 = have2_word[random.randint(0, len(have2_word) - 1)]
        what = what_word[random.randint(0, len(what_word) - 1)]
        text = template.format(greet=greet, explain=explain, pest=pest, character2=character2, have2=have2, what=what)
        data.append([text, '形态特征', label2id['形态特征']])

    template = "{greet}{explain}{pest}{have6}{character3}{ma}"
    for i in range(54):
        greet = greet_word[random.randint(0, len(greet_word) - 1)]
        explain = explain_word[random.randint(0, len(explain_word) - 1)]
        pest = pest_list[random.randint(0, pest_len)]
        character3 = character3_word[random.randint(0, len(character3_word) - 1)]
        have6 = have6_word[random.randint(0, len(have6_word) - 1)]
        ma = '吗'
        text = template.format(greet=greet, explain=explain, pest=pest, character3=character3, have6=have6, ma=ma)
        data.append([text, '形态特征', label2id['形态特征']])

    template = "{greet}{explain}{pest}{shi}{color}{de}{ma}"
    for i in range(20):
        greet = greet_word[random.randint(0, len(greet_word) - 1)]
        explain = explain_word[random.randint(0, len(explain_word) - 1)]
        pest = pest_list[random.randint(0, pest_len)]
        shi = '是'
        color = color_word[random.randint(0, len(color_word) - 1)]
        de = '的'
        ma = '吗'
        text = template.format(greet=greet, explain=explain, pest=pest, shi=shi, color=color, de=de, ma=ma)
        data.append([text, '形态特征', label2id['形态特征']])

    # 问区别
    ask_difference(pest_list, pest_len)

    # 农药
    # 问别名
    ask_alias(drug_list, drug_len)

    # 问简介
    ask_define(drug_list, drug_len)

    # 问农药使用方法
    template = "{greet}{explain}{how4}{suit}{use}{drug}"
    for i in range(12):
        greet = greet_word[random.randint(0, len(greet_word) - 1)]
        explain = explain_word[random.randint(0, len(explain_word) - 1)]
        drug = drug_list[random.randint(0, drug_len)]
        how4 = how4_word[random.randint(0, len(how4_word) - 1)]
        suit = suit_word[random.randint(0, len(suit_word) - 1)]
        use = use_word[random.randint(0, len(use_word) - 1)]
        text = template.format(greet=greet, explain=explain, how4=how4, suit=suit, use=use, drug=drug)
        data.append([text, '农药使用方法', label2id['农药使用方法']])

    template = "{greet}{explain}{cannot}{suit}{use}{drug}"
    for i in range(12):
        greet = greet_word[random.randint(0, len(greet_word) - 1)]
        explain = explain_word[random.randint(0, len(explain_word) - 1)]
        drug = drug_list[random.randint(0, drug_len)]
        cannot = cannot_word[random.randint(0, len(cannot_word) - 1)]
        suit = suit_word[random.randint(0, len(suit_word) - 1)]
        use = use_word[random.randint(0, len(use_word) - 1)]
        text = template.format(greet=greet, explain=explain, cannot=cannot, suit=suit, use=use, drug=drug)
        data.append([text, '农药使用方法', label2id['农药使用方法']])

    template = "{greet}{explain}{drug}{de}{suit}{use}{way}"
    for i in range(12):
        greet = greet_word[random.randint(0, len(greet_word) - 1)]
        explain = explain_word[random.randint(0, len(explain_word) - 1)]
        drug = drug_list[random.randint(0, drug_len)]
        de = '的'
        suit = suit_word[random.randint(0, len(suit_word) - 1)]
        use = use_word[random.randint(0, len(use_word) - 1)]
        way = way_word[random.randint(0, len(way_word) - 1)]
        if (i % 2 == 0):
            way = ''
        text = template.format(greet=greet, explain=explain, de=de, suit=suit, use=use, way=way, drug=drug)
        data.append([text, '农药使用方法', label2id['农药使用方法']])

    template = "{greet}{explain}{drug}{how4}{suit}{use}"
    for i in range(12):
        greet = greet_word[random.randint(0, len(greet_word) - 1)]
        explain = explain_word[random.randint(0, len(explain_word) - 1)]
        drug = drug_list[random.randint(0, drug_len)]
        how4 = how4_word[random.randint(0, len(how4_word) - 1)]
        suit = suit_word[random.randint(0, len(suit_word) - 1)]
        use = use_word[random.randint(0, len(use_word) - 1)]
        text = template.format(greet=greet, explain=explain, how4=how4, suit=suit, use=use, drug=drug)
        data.append([text, '农药使用方法', label2id['农药使用方法']])

    template = "{greet}{explain}{drug}{use}{where}"
    for i in range(12):
        greet = greet_word[random.randint(0, len(greet_word) - 1)]
        explain = explain_word[random.randint(0, len(explain_word) - 1)]
        drug = drug_list[random.randint(0, drug_len)]
        use = use_word[random.randint(0, len(use_word) - 1)]
        where = where_word[random.randint(0, len(where_word) - 1)]
        text = template.format(greet=greet, explain=explain, where=where, use=use, drug=drug)
        data.append([text, '农药使用方法', label2id['农药使用方法']])

    template = "{greet}{explain}{drug}{use2}"
    for i in range(40):
        greet = greet_word[random.randint(0, len(greet_word) - 1)]
        explain = explain_word[random.randint(0, len(explain_word) - 1)]
        drug = drug_list[random.randint(0, drug_len)]
        use2 = use2_word[random.randint(0, len(use2_word) - 1)]
        text = template.format(greet=greet, explain=explain, use2=use2, drug=drug)
        data.append([text, '农药使用方法', label2id['农药使用方法']])

    # 问农药毒性
    template = "{greet}{explain}{drug}{toxicity1}"
    for i in range(36):
        greet = greet_word[random.randint(0, len(greet_word) - 1)]
        explain = explain_word[random.randint(0, len(explain_word) - 1)]
        drug = drug_list[random.randint(0, drug_len)]
        toxicity1 = toxicity1_word[random.randint(0, len(toxicity1_word) - 1)]
        text = template.format(greet=greet, explain=explain, drug=drug, toxicity1=toxicity1)
        data.append([text, '农药毒性', label2id['农药毒性']])

    template = "{greet}{explain}{drug}{may}{toxicity2}{crop}{ma}"
    for i in range(36):
        greet = greet_word[random.randint(0, len(greet_word) - 1)]
        explain = explain_word[random.randint(0, len(explain_word) - 1)]
        drug = drug_list[random.randint(0, drug_len)]
        may = may_word[random.randint(0, len(may_word) - 1)]
        toxicity2 = toxicity2_word[random.randint(0, len(toxicity2_word) - 1)]
        crop = crop_list[random.randint(0, crop_len)]
        if (i % 5 == 0):
            crop = '作物'
            if (i % 10 == 0):
                crop = '种子'
        ma = '吗'
        text = template.format(greet=greet, explain=explain, drug=drug, may=may, toxicity2=toxicity2, crop=crop, ma=ma)
        data.append([text, '农药毒性', label2id['农药毒性']])

    template = "{greet}{explain}{drug}{have6}{what}{toxicity3}"
    for i in range(36):
        greet = greet_word[random.randint(0, len(greet_word) - 1)]
        explain = explain_word[random.randint(0, len(explain_word) - 1)]
        drug = drug_list[random.randint(0, drug_len)]
        have6 = have6_word[random.randint(0, len(have6_word) - 1)]
        what = what_word[random.randint(0, len(what_word) - 1)]
        toxicity3 = toxicity3_word[random.randint(0, len(toxicity3_word) - 1)]
        text = template.format(greet=greet, explain=explain, drug=drug, have6=have6, what=what, toxicity3=toxicity3)
        data.append([text, '农药毒性', label2id['农药毒性']])

    template = "{greet}{explain}{drug}{may}{stop2}{crop}{de}{grow}"
    for i in range(36):
        greet = greet_word[random.randint(0, len(greet_word) - 1)]
        explain = explain_word[random.randint(0, len(explain_word) - 1)]
        drug = drug_list[random.randint(0, drug_len)]
        may = may_word[random.randint(0, len(may_word) - 1)]
        stop2 = stop2_word[random.randint(0, len(stop2_word) - 1)]
        crop = crop_list[random.randint(0, crop_len)]
        if (i % 5 == 0):
            crop = '作物'
            if (i % 10 == 0):
                crop = '种子'
        de = '的'
        grow = grow_word[random.randint(0, len(grow_word) - 1)]
        text = template.format(greet=greet, explain=explain, drug=drug, may=may, stop2=stop2, crop=crop, de=de,
                               grow=grow)
        data.append([text, '农药毒性', label2id['农药毒性']])

    template = "{greet}{explain}{drug}{face}{crop}{have6}{toxicity2}{role}{ma}"
    for i in range(36):
        greet = greet_word[random.randint(0, len(greet_word) - 1)]
        explain = explain_word[random.randint(0, len(explain_word) - 1)]
        drug = drug_list[random.randint(0, drug_len)]
        face = face_word[random.randint(0, len(face_word) - 1)]
        crop = crop_list[random.randint(0, crop_len)]
        if (i % 5 == 0):
            crop = '作物'
            if (i % 10 == 0):
                crop = '种子'
        have6 = have6_word[random.randint(0, len(have6_word) - 1)]
        toxicity2 = toxicity2_word[random.randint(0, len(toxicity2_word) - 1)]
        role = role_word[random.randint(0, len(role_word) - 1)]
        ma = '吗'
        text = template.format(greet=greet, explain=explain, drug=drug, face=face, have6=have6, crop=crop,
                               toxicity2=toxicity2, role=role, ma=ma)
        data.append([text, '农药毒性', label2id['农药毒性']])

    # 问区别
    ask_difference(drug_list, drug_len)

    # 问农药用途
    template = "{greet}{explain}{drug}{de}{role2}"
    for i in range(38):
        greet = greet_word[random.randint(0, len(greet_word) - 1)]
        explain = explain_word[random.randint(0, len(explain_word) - 1)]
        drug = drug_list[random.randint(0, drug_len)]
        de = '的'
        role2 = role2_word[random.randint(0, len(role2_word) - 1)]
        text = template.format(greet=greet, explain=explain, drug=drug, de=de, role2=role2)
        data.append([text, '农药用途', label2id['农药用途']])

    template = "{greet}{explain}{drug}{de}{role2}{shi}{what}"
    for i in range(38):
        greet = greet_word[random.randint(0, len(greet_word) - 1)]
        explain = explain_word[random.randint(0, len(explain_word) - 1)]
        drug = drug_list[random.randint(0, drug_len)]
        de = '的'
        role2 = role2_word[random.randint(0, len(role2_word) - 1)]
        shi = '是'
        what = what_word[random.randint(0, len(what_word) - 1)]
        text = template.format(greet=greet, explain=explain, drug=drug, de=de, role2=role2, what=what, shi=shi)
        data.append([text, '农药用途', label2id['农药用途']])

    template = "{greet}{explain}{drug}{have8}{what}{role2}"
    for i in range(38):
        greet = greet_word[random.randint(0, len(greet_word) - 1)]
        explain = explain_word[random.randint(0, len(explain_word) - 1)]
        drug = drug_list[random.randint(0, drug_len)]
        have8 = have8_word[random.randint(0, len(have8_word) - 1)]
        what = what_word[random.randint(0, len(what_word) - 1)]
        role2 = role2_word[random.randint(0, len(role2_word) - 1)]
        text = template.format(greet=greet, explain=explain, drug=drug, have8=have8, role2=role2, what=what)
        data.append([text, '农药用途', label2id['农药用途']])

    template = "{greet}{explain}{use}{drug}{hou}{de}{change}"
    for i in range(38):
        greet = greet_word[random.randint(0, len(greet_word) - 1)]
        explain = explain_word[random.randint(0, len(explain_word) - 1)]
        use = use_word[random.randint(0, len(use_word) - 1)]
        drug = drug_list[random.randint(0, drug_len)]
        hou = '后'
        de = '的'
        change = change_word[random.randint(0, len(change_word) - 1)]
        text = template.format(greet=greet, explain=explain, use=use, drug=drug, hou=hou, de=de, change=change)
        data.append([text, '农药用途', label2id['农药用途']])

    template = "{greet}{explain}{drug}{shi}{do}{what2}{de}"
    for i in range(10):
        greet = greet_word[random.randint(0, len(greet_word) - 1)]
        explain = explain_word[random.randint(0, len(explain_word) - 1)]
        drug = drug_list[random.randint(0, drug_len)]
        shi = '是'
        do = do_word[random.randint(0, len(do_word) - 1)]
        what2 = what2_word[random.randint(0, len(what2_word) - 1)]
        de = '的'
        text = template.format(greet=greet, explain=explain, drug=drug, shi=shi, do=do, what2=what2, de=de)
        data.append([text, '农药用途', label2id['农药用途']])

    template = "{greet}{explain}{drug}{have8}{role3}{de}{role2}{ma}"
    for i in range(38):
        greet = greet_word[random.randint(0, len(greet_word) - 1)]
        explain = explain_word[random.randint(0, len(explain_word) - 1)]
        drug = drug_list[random.randint(0, drug_len)]
        have8 = have8_word[random.randint(0, len(have8_word) - 1)]
        role3 = role3_word[random.randint(0, len(role3_word) - 1)]
        de = '的'
        role2 = role2_word[random.randint(0, len(role2_word) - 1)]
        ma = '吗'
        text = template.format(greet=greet, explain=explain, drug=drug, have8=have8, role3=role3, de=de, role2=role2,
                               ma=ma)
        data.append([text, '农药用途', label2id['农药用途']])

    # 问农药防治对象
    template = "{greet}{explain}{drug}{de}{protect}{target2}"
    for i in range(15):
        greet = greet_word[random.randint(0, len(greet_word) - 1)]
        explain = explain_word[random.randint(0, len(explain_word) - 1)]
        drug = drug_list[random.randint(0, drug_len)]
        de = '的'
        protect = protect_word[random.randint(0, len(protect_word) - 1)]
        target2 = target2_word[random.randint(0, len(target2_word) - 1)]
        text = template.format(greet=greet, explain=explain, drug=drug, de=de, protect=protect, target2=target2)
        data.append([text, '农药防治对象', label2id['农药防治对象']])

    template = "{greet}{explain}{drug}{de}{protect}{target2}{have2}{what}"
    for i in range(15):
        greet = greet_word[random.randint(0, len(greet_word) - 1)]
        explain = explain_word[random.randint(0, len(explain_word) - 1)]
        drug = drug_list[random.randint(0, drug_len)]
        de = '的'
        protect = protect_word[random.randint(0, len(protect_word) - 1)]
        target2 = target2_word[random.randint(0, len(target2_word) - 1)]
        have2 = have2_word[random.randint(0, len(have2_word) - 1)]
        what = what_word[random.randint(0, len(what_word) - 1)]
        text = template.format(greet=greet, explain=explain, drug=drug, de=de, protect=protect, target2=target2,
                               have2=have2, what=what)
        data.append([text, '农药防治对象', label2id['农药防治对象']])

    template = "{greet}{explain}{drug}{can}{causative}{pest}{none}{ma}"
    for i in range(25):
        greet = greet_word[random.randint(0, len(greet_word) - 1)]
        explain = explain_word[random.randint(0, len(explain_word) - 1)]
        drug = drug_list[random.randint(0, drug_len)]
        can = can_word[random.randint(0, len(can_word) - 1)]
        causative = causative_word[random.randint(0, len(causative_word) - 1)]
        pest = pest_list[random.randint(0, pest_len)]
        if (i % 5 == 0):
            pest = '害虫'
        none = none_word[random.randint(0, len(none_word) - 1)]
        ma = '吗'
        text = template.format(greet=greet, explain=explain, drug=drug, can=can, causative=causative, pest=pest,
                               none=none, ma=ma)
        data.append([text, '农药防治对象', label2id['农药防治对象']])

    template = "{greet}{explain}{drug}{can}{kill}{all}{pest}{ma}"
    for i in range(25):
        greet = greet_word[random.randint(0, len(greet_word) - 1)]
        explain = explain_word[random.randint(0, len(explain_word) - 1)]
        drug = drug_list[random.randint(0, drug_len)]
        can = can_word[random.randint(0, len(can_word) - 1)]
        kill = kill_word[random.randint(0, len(kill_word) - 1)]
        all = all_word[random.randint(0, len(all_word) - 1)]
        pest = pest_list[random.randint(0, pest_len)]
        if (i % 5 == 0):
            pest = '害虫'
        ma = '吗'
        text = template.format(greet=greet, explain=explain, drug=drug, can=can, kill=kill, all=all, pest=pest, ma=ma)
        data.append([text, '农药防治对象', label2id['农药防治对象']])

    template = "{greet}{explain}{drug}{face}{pest}{have6}{role2}{ma}"
    for i in range(25):
        greet = greet_word[random.randint(0, len(greet_word) - 1)]
        explain = explain_word[random.randint(0, len(explain_word) - 1)]
        drug = drug_list[random.randint(0, drug_len)]
        face = face_word[random.randint(0, len(face_word) - 1)]
        pest = pest_list[random.randint(0, pest_len)]
        if (i % 5 == 0):
            pest = '害虫'
        have6 = have6_word[random.randint(0, len(have6_word) - 1)]
        role2 = role2_word[random.randint(0, len(role2_word) - 1)]
        ma = '吗'
        text = template.format(greet=greet, explain=explain, drug=drug, face=face, have6=have6, role2=role2, pest=pest,
                               ma=ma)
        data.append([text, '农药防治对象', label2id['农药防治对象']])

    template = "{greet}{explain}{drug}{face}{crop}{shang}{have}{de}{pest}{have6}{role2}{ma}"
    for i in range(25):
        greet = greet_word[random.randint(0, len(greet_word) - 1)]
        explain = explain_word[random.randint(0, len(explain_word) - 1)]
        drug = drug_list[random.randint(0, drug_len)]
        face = face_word[random.randint(0, len(face_word) - 1)]
        crop = crop_list[random.randint(0, crop_len)]
        if (i % 10 == 0):
            crop = '作物'
        shang = '上'
        have = have_word[random.randint(0, len(have_word) - 1)]
        de = '的'
        pest = pest_list[random.randint(0, pest_len)]
        if (i % 5 == 0):
            pest = '害虫'
        have6 = have6_word[random.randint(0, len(have6_word) - 1)]
        role2 = role2_word[random.randint(0, len(role2_word) - 1)]
        ma = '吗'
        text = template.format(greet=greet, explain=explain, drug=drug, face=face, crop=crop, shang=shang, have=have,
                               de=de, pest=pest, have6=have6, role2=role2, ma=ma)
        data.append([text, '农药防治对象', label2id['农药防治对象']])

    template = "{greet}{explain}{drug}{face}{get}{disease}{de}{crop}{have8}{role2}{ma}"
    for i in range(25):
        greet = greet_word[random.randint(0, len(greet_word) - 1)]
        explain = explain_word[random.randint(0, len(explain_word) - 1)]
        drug = drug_list[random.randint(0, drug_len)]
        face = face_word[random.randint(0, len(face_word) - 1)]
        get = get_word[random.randint(0, len(get_word) - 1)]
        disease = disease_list[random.randint(0, disease_len)]
        if (i % 5 == 0):
            disease = '病害'
        de = '的'
        crop = crop_list[random.randint(0, crop_len)]
        if (i % 10 == 0):
            crop = '作物'
        have8 = have8_word[random.randint(0, len(have8_word) - 1)]
        role2 = role2_word[random.randint(0, len(role2_word) - 1)]
        ma = '吗'
        text = template.format(greet=greet, explain=explain, drug=drug, face=face, crop=crop, get=get, have8=have8,
                               de=de, disease=disease, role2=role2, ma=ma)
        data.append([text, '农药防治对象', label2id['农药防治对象']])

    template = "{greet}{explain}{drug}{face}{disease}{have6}{role2}{ma}"
    for i in range(25):
        greet = greet_word[random.randint(0, len(greet_word) - 1)]
        explain = explain_word[random.randint(0, len(explain_word) - 1)]
        drug = drug_list[random.randint(0, drug_len)]
        face = face_word[random.randint(0, len(face_word) - 1)]
        disease = disease_list[random.randint(0, disease_len)]
        if (i % 5 == 0):
            disease = '病害'
        have6 = have6_word[random.randint(0, len(have6_word) - 1)]
        role2 = role2_word[random.randint(0, len(role2_word) - 1)]
        ma = '吗'
        text = template.format(greet=greet, explain=explain, drug=drug, face=face, have6=have6, disease=disease,
                               role2=role2, ma=ma)
        data.append([text, '农药防治对象', label2id['农药防治对象']])

    template = "{greet}{explain}{drug}{can}{causative}{disease}{none}{ma}"
    for i in range(25):
        greet = greet_word[random.randint(0, len(greet_word) - 1)]
        explain = explain_word[random.randint(0, len(explain_word) - 1)]
        drug = drug_list[random.randint(0, drug_len)]
        can = can_word[random.randint(0, len(can_word) - 1)]
        causative = causative_word[random.randint(0, len(causative_word) - 1)]
        disease = disease_list[random.randint(0, disease_len)]
        if (i % 5 == 0):
            disease = '病害'
        none = none_word[random.randint(0, len(none_word) - 1)]
        ma = '吗'
        text = template.format(greet=greet, explain=explain, drug=drug, can=can, causative=causative, disease=disease,
                               none=none, ma=ma)
        data.append([text, '农药防治对象', label2id['农药防治对象']])

    return data


# 生成模板数据
def create_template_data():
    data = get_template_data()
    df = pd.DataFrame(data, columns=['text', 'label_class', 'label'])
    # 在df.sample()函数中设置frac=1.0时可以实现shuffle
    data = df.sample(frac=1.0)
    data.to_csv(config.template_data_path, index=False, encoding='utf8')


if __name__ == '__main__':
    # 构建模板数据
    create_template_data()

    # 针对人工标注的数据生成回译数据
    # create_retroversion_data(config.raw_data_path)
